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); }
/// <summary> /// 根据桌子查找所有的资料 /// </summary> /// <param name="deskid"></param> /// <returns></returns> public List <T_Office_Files> GetT_Office_Files(int deskid) { //先获取桌子 T_Product_office_desk_detail desk = bll_desk.GetT_Product_office_desk_detail(deskid, ""); //再获取这个桌子的所有文件 var query = from x in read_db.T_Office_Files where x.Mode == desk.Mode || x.Mode == desk.ColumnType || x.Mode == desk.FootType || x.Mode == desk.SideBracketType || x.Mode == desk.FrameType select x; List <T_Office_Files> flist = new List <T_Office_Files>(); foreach (T_Office_Files f in query) { if (string.IsNullOrEmpty(f.thumbnailImg)) { if (f.Type.Contains("doc")) { f.thumbnailImg = "/resourse/Img/word_icon.png"; } if (f.Type.Contains("excel")) { f.thumbnailImg = "/resourse/Img/excel_icon.png"; } f.thumbnailImg = "/resourse/Img/pdf_icon.png"; } flist.Add(f); } return(query.ToList()); }
public int AddT_Product_office_desk_detail(T_Product_office_desk_detail detail) { int i = base.AddEntities <T_Product_office_desk_detail>(detail); return(i); }
public T_Product_office_desk_detail GetT_Product_office_desk_detail(int desk_id, string langCode) { T_Product_office_desk_detail model = read_db.T_Product_office_desk_detail.Where(x => x.T_Product_office_desk_Id == desk_id).FirstOrDefault(); if (model != null) { //立柱 if (model.ColumnType != null && model.ColumnType != "") { model.T_Part_office_Column = GetT_Part_office_Column(model.ColumnType, langCode); } //框架 if (model.FrameType != null && model.FrameType != "") { model.T_Part_office_Frame = GetT_Part_office_Frame(model.FrameType, langCode); } //地脚 if (model.FootType != null && model.FootType != "") { model.T_Part_office_Foot = GetT_Part_office_Foot(model.FootType, langCode); } //侧板 if (model.SideBracketType != null && model.SideBracketType != "") { model.T_Part_office_SideBracket = GetT_Part_office_SideBracket(model.SideBracketType, langCode); } //控制器 if (model.ControlboxType != null && model.ControlboxType != "") { model.T_Part_office_ControlBox = GetT_Part_office_ControlBox(model.ControlboxType, langCode); } //手控器 if (model.HandsetType != null && model.HandsetType != "") { model.T_Part_office_HandSet = GetT_Part_office_HandSet(model.HandsetType, langCode); } //电源线 if (model.select_PowercableMode != null && model.select_PowercableMode != "") { model.T_Part_office_Powercable = GetT_Part_office_Powercable(model.select_PowercableMode, langCode); } //颜色 if (model.select_ColorMode != null && model.select_ColorMode != "") { model.T_Office_Color = GetT_Office_Color(model.select_ColorMode, langCode); } return(model); } else { return(null); } }
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); }
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()); } }