using System; using System.Linq; using System.Web.Mvc; using DSWeb.MvcShipping.DAL.MsCwDesignStartusingDAL; using DSWeb.MvcShipping.Models.MsCwDesignStartusing; using DSWeb.MvcShipping.Helper; using DSWeb.MvcShipping.Comm.Cookie; using HcUtility.Comm; using HcUtility.Core; using System.Collections.Generic; using DSWeb.MvcShipping.DAL.MsBaseInfoDAL; using DSWeb.EntityDA; using DSWeb.Areas.CommMng.DAL; namespace DSWeb.MvcShipping.Controllers { [JsonRequestBehavior] public class MsCwDesignStartusingUserController : Controller { public ActionResult Index() { return View(); } #region 查询 public ContentResult GetDataList(string condition) { var dataList = MsCwDesignStartusingDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() }); return new ContentResult() { Content = json }; } public ContentResult GetData(string handle, string condition) { MsCwDesignStartusing head = null; if (handle == "edit") { head = MsCwDesignStartusingDAL.GetData(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));// head.MODIFIEDUSER = Convert.ToString(Session["USERID"]); head.MODIFIEDTIME = DateTime.Now; } if (head == null) { head = new MsCwDesignStartusing(); head.CORPID = Convert.ToString(Session["COMPANYID"]); head.CREATEUSER = Convert.ToString(Session["USERID"]); head.CREATETIME = DateTime.Now; head.MODIFIEDUSER = Convert.ToString(Session["USERID"]); head.MODIFIEDTIME = DateTime.Now; } var json = JsonConvert.Serialize( new { Success = true, Message = "查询成功", data = head }); return new ContentResult() { Content = json }; } #endregion #region 登录 //public ContentResult onISLOGIN(string data) //{ // //if (Convert.ToString(Session["COMPANYID"]).Trim() == "" || Convert.ToString(Session["USERID"]).Trim() == "" || Convert.ToString(Session["CODENAME"]).Trim() == "" || Convert.ToString(Session["SHOWNAME"]).Trim() == "" || Convert.ToString(Session["DEPTNAME"]).Trim() == "") // //{ // // var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; // // return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; // //} // //// // //var modb = new ModelObjectDB(); // //var head = JsonConvert.Deserialize(data); // //DBResult result = MsCwDesignStartusingDAL.onISLOGIN(head, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"])); // //var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; // //return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; //} #endregion } }