public ActionResult GetOfficeDeskDetail(string productGuid, string lang) { T_Product_office_desk _T_Product_office_desk = bll_desk.GetT_Product_office_desk(productGuid); T_Product_office_desk_detail _T_Product_office_desk_detail = bll_desk.GetT_Product_office_desk_detail(_T_Product_office_desk.Id, lang); T_Product_office_description m = bll_desk.GetT_Product_office_description_first(_T_Product_office_desk_detail.introductionIndex, lang); _T_Product_office_desk_detail.introduction = m == null ? "" : m.textValue; //产品介绍 List <T_Product_office_description> descriptions = bll_desk.GetT_Product_office_description(_T_Product_office_desk_detail.DescriptionIndex, lang); //产品关键参数 List <T_Office_Files> T_Office_Files = bll_file.GetT_Office_Files(_T_Product_office_desk.Id); //收藏 T_Office_desk_collect collect = new T_Office_desk_collect(); if (Session["emailName"] != null && Session["emailName"].ToString() != "") { string pname = Session["emailName"].ToString(); collect = bll_collect.GetT_Office_desk_collect(_T_Product_office_desk.Id, pname); } var list = new { T_Product_office_desk = _T_Product_office_desk, T_Product_office_desk_detail = _T_Product_office_desk_detail, descriptions = descriptions, T_Office_Files = T_Office_Files, collect = collect, }; JsonResult jr = Json(list, JsonRequestBehavior.AllowGet); jr.MaxJsonLength = int.MaxValue; return(jr); }
public ActionResult GetOfficeDeskDetail2(string productGuid, string lang) { T_Product_office_desk _T_Product_office_desk = bll_desk.GetT_Product_office_desk(productGuid); T_Product_office_desk_detail _T_Product_office_desk_detail = bll_desk.GetT_Product_office_desk_detail(_T_Product_office_desk.Id, lang); var list = new { T_Product_office_desk = _T_Product_office_desk, T_Product_office_desk_detail = _T_Product_office_desk_detail, }; JsonResult jr = Json(list, JsonRequestBehavior.AllowGet); jr.MaxJsonLength = int.MaxValue; return(jr); }
/// <summary> /// 添加桌子并返回桌子的ID /// </summary> /// <param name="desk"></param> /// <returns></returns> public int AddT_Product_office_desk(T_Product_office_desk desk) { string guid = desk.deskGuid; if (string.IsNullOrEmpty(guid)) { return(-2); } int suc = base.AddEntities <T_Product_office_desk>(desk); if (suc > 0) { var q = read_db.T_Product_office_desk.Where(x => x.deskGuid == guid).FirstOrDefault(); return(q.Id); } return(0); }
public JsonResult saveConfigurations(string select_columnMode, string select_frameMode, string select_footMode, string select_SideBracketMode, string select_ColorMode, string select_ControlBoxMode, string select_HandSetMode, string select_PowercableMode, string frameWidth, string frameHeight, string langCode, string Type, string custmerName) { string msgType = string.Empty; string msg = string.Empty; //登录权限验证 if (Session["emailName"] != null && Session["emailName"].ToString() != "") { T_Part_office_Column column = bll_desk.GetT_Part_office_Column(select_columnMode, langCode); //数据有效性验证 string pname = Session["emailName"].ToString(); T_Product_office_desk de = new T_Product_office_desk(); string mode = select_columnMode.Replace("-", ""); mode = mode.Substring(mode.Length - 4, 4); de.deskType = Type; de.deskCustmoer = true; de.deskCreateByUser = pname; de.deskSerialName = string.Format("{0}", "JC35" + Type + "-" + mode + "-" + select_footMode.Substring(select_footMode.Length - 3, select_footMode.Length - 3) + "-" + select_frameMode.Substring(select_frameMode.Length - 5, select_frameMode.Length - 5) + "-" + select_SideBracketMode.Replace("SIDE", "")); de.deskImgUrl = "/resourse/desk_TS_picture/effectImg1.png"; de.deskMaxLoad = Convert.ToDouble(column.MaxLoad); de.deskNewProduct = false; de.deskJCRecommend = false; de.verificationCode = BLL_Ofiice_Configuration.CreateConfigurationCode(de.deskGuid, false, pname, Type, mode); int deskid = bll_desk.AddT_Product_office_desk(de); if (deskid < 1) { //失败 msgType = "false"; msg = "添加桌子失败"; } else { T_Product_office_desk_detail dd = new T_Product_office_desk_detail(); dd.T_Product_office_desk_Id = deskid; dd.deskGuid = de.deskGuid; dd.ColumnType = select_columnMode; dd.FrameType = select_frameMode; dd.FootType = select_footMode; dd.SideBracketType = select_SideBracketMode; dd.select_ColorMode = select_ColorMode; //颜色 dd.ControlboxType = select_ControlBoxMode; dd.HandsetType = select_HandSetMode; dd.select_PowercableMode = select_PowercableMode; //电源线 dd.frameWidth = frameWidth; //宽度 dd.frameHeight = frameHeight; //高度 dd.Mode = "JC35" + Type + "-" + mode; dd.Type = mode; dd.Level = int.Parse(mode.Substring(mode.Length - 2, 1)); string form = ""; switch (mode.Substring(0, 1)) { case "s": form = "square"; break; case "c": form = "round"; break; case "r": form = "rectangle"; break; case "e": form = "ellipse"; break; } dd.Form = form; dd.Size_Out = column.Size_Out; dd.Size_Middle = column.Size_Middle; dd.Size_Inside = column.Size_Inside; dd.StrokeLength = column.StrokeLength; dd.LowestPosition = column.LowestPosition; dd.HighestPosition = column.HighestPosition; dd.MaxLoad = column.MaxLoad; dd.LoadCapacity = column.LoadCapacity; dd.Speed = column.Speed; string powertype = ""; switch (Type) { case "TO": powertype = "SingleMotor"; break; case "TS": powertype = "DoubleMotor"; break; case "TT": powertype = "ThreeMotor"; break; case "TF": powertype = "FourMotor"; break; } dd.PowerType = powertype; dd.configurationNo = de.verificationCode; dd.DescriptionIndex = dd.T_Product_office_desk_Id + 100; dd.introductionIndex = dd.T_Product_office_desk_Id + 200; int suc = bll_desk.AddT_Product_office_desk_detail(dd); T_Product_office_desk_customer cus = new T_Product_office_desk_customer(); cus.deskGuid = de.deskGuid; cus.langCode = langCode; cus.configurationName = custmerName; cus.customerUserName = pname; int suc_cus = bll_customer.AddT_Product_office_desk_customer(cus); //成功 msgType = "true"; } } else { //失败 权限检查 msgType = "false"; msg = "请先登录"; } var param = new { type = msgType, msg = msg, }; JsonResult jr = Json(param, JsonRequestBehavior.AllowGet); jr.MaxJsonLength = int.MaxValue; return(jr); }
// GET: T_Product_office_text 桌子的相关信息描述 public ActionResult Index(string Mode, string Key, string langCode) { ViewBag.Mode = Mode; ViewBag.Key = Key; ViewBag.langCode = langCode; if (Mode == null || Mode == "") { return(View()); } else { try { T_Product_office_desk desk = db.T_Product_office_desk.Where(x => x.deskSerialName == Mode).FirstOrDefault(); T_Product_office_desk_detail deskdetail = bll.GetT_Product_office_desk_detail(desk.Id, ""); ViewBag.desk = desk; ViewBag.deskdetail = deskdetail; //标签 短描述 List <T_Product_office_text> list = new List <T_Product_office_text>(); if (desk.deskShortDescriptionKey != 0) { var q = from x in db.T_Product_office_text where x.textKay == desk.deskShortDescriptionKey select x; list.AddRange(q.ToList()); } if (desk.deskTagKey != 0) { var q = from x in db.T_Product_office_text where x.textKay == desk.deskTagKey select x; list.AddRange(q.ToList()); } if (Key != "") { int ikey = Convert.ToInt32(Key); list = list.Where(x => x.textKay == ikey).ToList(); } if (langCode != "") { list = list.Where(x => x.langCode == langCode).ToList(); } ViewBag.T_Product_office_texts = list; // //长描述 关键参数 List <T_Product_office_description> list2 = new List <T_Product_office_description>(); if (deskdetail.DescriptionIndex != 0) { var q = from x in db.T_Product_office_description where x.textKay == deskdetail.DescriptionIndex select x; list2.AddRange(q.ToList()); } if (deskdetail.introductionIndex != 0) { var q = from x in db.T_Product_office_description where x.textKay == deskdetail.introductionIndex select x; list2.AddRange(q.ToList()); } if (Key != "") { int ikey = Convert.ToInt32(Key); list2 = list2.Where(x => x.textKay == ikey).ToList(); } if (langCode != "") { list2 = list2.Where(x => x.langCode == langCode).ToList(); } ViewBag.T_Product_office_descriptions = list2; } catch (Exception ex) { } return(View()); } }
public List <T_Product_office_desk> GetT_Product_office_desk(string Type, string langCode, string recommend, string searchText, string userName) { var query = from x in read_db.T_Product_office_desk join Tag in read_db.T_Product_office_text on x.deskTagKey equals Tag.textKay into dc from dci in dc.DefaultIfEmpty() join ShortDes in read_db.T_Product_office_text on x.deskShortDescriptionKey equals ShortDes.textKay into dd from ddi in dd.DefaultIfEmpty() where dci.langCode == langCode where ddi.langCode == langCode where x.deskType == Type where x.deleteSign != 1 select new { //---t_base //查找原因后发现是UpdateTime和JSON转换的原因 Id = x.Id, verificationCode = x.verificationCode, UpdateTime = x.UpdateTime, CreateTime = x.CreateTime, deletePerson = x.deletePerson, CreatePerson = x.CreatePerson, UpdatePerson = x.UpdatePerson, Remark = x.Remark, //----end of t_base deskGuid = x.deskGuid, deskType = x.deskType, deskTagKey = x.deskTagKey, deskShortDescriptionKey = x.deskShortDescriptionKey, deskSerialName = x.deskSerialName, deskImgUrl = x.deskImgUrl, deskSalesVolume = x.deskSalesVolume, deskPrice = x.deskPrice, deskStabilityLeave = x.deskStabilityLeave, deskMaxLoad = x.deskMaxLoad, deskNewProductNumber = x.deskNewProductNumber, deskNewProduct = x.deskNewProduct, deskJCRecommend = x.deskJCRecommend, deskCreateByUser = x.deskCreateByUser, deskTag = dci.textValue, deskShortDescription = ddi.textValue, deskCustmoer = x.deskCustmoer, }; switch (recommend) { case "newProduct": query = query.Where(x => x.deskNewProduct == true); break; case "jiecangProduct": query = query.Where(x => x.deskJCRecommend == true); break; case "customer": query = query.Where(x => x.deskCustmoer == true && x.deskCreateByUser == userName); break; //补充我的定制 default: query = null; break; } if (searchText.Trim() != "") { query = query.Where(x => x.deskSerialName.Contains(searchText.Trim())); } List <T_Product_office_desk> list = new List <T_Product_office_desk>(); foreach (var model in query) { string str = JsonConvert.SerializeObject(model); // T_Product_office_desk mmm = JsonToObject<T_Product_office_desk>(str); T_Product_office_desk mmm = JsonConvert.DeserializeObject <T_Product_office_desk>(str); if (mmm.deskTag == null) { mmm.deskTag = ""; } if (mmm.deskShortDescription == null) { mmm.deskShortDescription = ""; } list.Add(mmm); } return(list); }