131 lines
4.1 KiB
C#
131 lines
4.1 KiB
C#
using Face.Domain.Application;
|
|
using Face.Domain.Application.FaceAll;
|
|
using Face.Domain.Entities;
|
|
using Face.Domain.ViewModels;
|
|
using Face.Services.DBUtility.Custom;
|
|
using Face.Services.Manager;
|
|
using Face.Web.Areas.App.Models;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Web;
|
|
using System.Web.Hosting;
|
|
using System.Web.Mvc;
|
|
using static Face.Web.Areas.App.Models.Roominfo;
|
|
|
|
namespace Face.Web.Areas.App.Controllers
|
|
{
|
|
public class ExpandController : Controller
|
|
{
|
|
// GET: App/Expand
|
|
public ActionResult ExpandIndex()
|
|
{
|
|
return View();
|
|
}
|
|
private string connectionString = "Server=blv-cloud-db.mysql.rds.aliyuncs.com;Database=Face;Uid=blv_rcu;Pwd=fnadiaJDIJ7546;charset=utf8;port=3307;";
|
|
|
|
[HttpPost]
|
|
public ActionResult Expandinsert(string name, int id_no,string idcode)
|
|
{
|
|
tb_HotelCode face = new tb_HotelCode();
|
|
face.UserWX = true;
|
|
face.Code = idcode;
|
|
face.Remark = name;
|
|
face.HotelID = id_no;
|
|
if (SqlSugarBase.WuDb.Insertable(face).ExecuteCommand()>0)
|
|
{
|
|
return Json("200");
|
|
}
|
|
return Json("100");
|
|
}
|
|
|
|
|
|
public ActionResult UploadingAll()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult conditionFile()
|
|
{
|
|
|
|
return View();
|
|
}
|
|
|
|
|
|
public ActionResult Dropdownlist(int Hoteid)
|
|
{
|
|
List<Result> relist = null;
|
|
var ho = SqlSugarBase.authoriydb.Queryable<Hotels>().First(x => x.Id == Hoteid);
|
|
GetRoomInterface.test test = new GetRoomInterface.test
|
|
{
|
|
code = ho.Code.ToString(),
|
|
creatDate = ho.CreateTime.ToString("yyyy-MM-dd")
|
|
};
|
|
Roominfo.Root asd = GetRoomInterface.Roomport(test);
|
|
if (asd.IsSuccess == true)
|
|
{
|
|
|
|
relist = asd.Result;
|
|
return Json(new
|
|
{
|
|
Data = relist,
|
|
Status=200
|
|
});
|
|
|
|
}
|
|
else
|
|
{
|
|
return Json(new
|
|
{
|
|
Data = "",
|
|
Status = 50
|
|
});
|
|
}
|
|
}
|
|
public ActionResult Conditionfileawholelog(Condition data)
|
|
{
|
|
string strSql = "";
|
|
using (MySql.Data.MySqlClient.MySqlConnection connection = new MySql.Data.MySqlClient.MySqlConnection(connectionString))
|
|
{
|
|
System.Data.DataSet dataSet = new System.Data.DataSet();
|
|
strSql += "select * from fileawholelog where filetype=" + data.filetype;
|
|
|
|
if (data.HotelID != 0)
|
|
{
|
|
strSql += " and hotelid=" + data.HotelID;
|
|
}
|
|
if (data.roomid != 0)
|
|
{
|
|
strSql += " and roomid=" + data.HotelID;
|
|
}
|
|
string sqlnumber = strSql;
|
|
var strCountSql = strSql.ToString();
|
|
var countNum = new DALHelperCustom<fileawholelog>("TBL_ColorBoxList").SqlQueryGetList(strCountSql.ToString());
|
|
if (countNum != null)
|
|
{
|
|
ViewBag.allpage = (countNum.Count / 20) + 1;
|
|
}
|
|
else
|
|
{
|
|
ViewBag.allpage = 0;
|
|
}
|
|
strSql += " ORDER BY `creationtime` DESC LIMIT " + (data.dataMin) + ",8;";
|
|
|
|
ViewData["tableData"] = null;
|
|
//if (countNum[0].ID <= 0)
|
|
// return PartialView("_NamedQueryData");
|
|
//strSql.Append(" order by StartTime desc LIMIT " + data.Pages + ",20");
|
|
|
|
MySql.Data.MySqlClient.MySqlDataAdapter command = new MySql.Data.MySqlClient.MySqlDataAdapter(strSql.ToString(), connection);
|
|
command.Fill(dataSet, "test");
|
|
ViewData["tableDataimp"] = dataSet;
|
|
return View();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
} |