public ActionResult DeleteConfirmed(int id)
        {
            T_Part_office_Column t_Part_office_Column = db.T_Part_office_Column.Find(id);

            db.T_Part_office_Column.Remove(t_Part_office_Column);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Mode,Type,Level,Form,Size_Out,Size_Middle,Size_Inside,StrokeLength,MaxStroke,LowestPosition,HighestPosition,LoadCapacity,MaxLoad,Speed,MaxSpeed,Power,StabilityLeave,MotorCode,HaveMotor,Inline,InsideSlider,SingleMotor,HandCranking,GasSpring,CanEZ,CanFold,CanTurn,GS,EN527,CE,EMC,BIFMA,UL962,DrawingNum2D,DrawingNum3D,DrawingName3D,DrawingName2D,PictureName,PictureNum,PartCode,Weight,DescriptionZH,DescriptionEN,ColumnWithFoot,ColumnWithFrame,HandsetConnect,ControlboxConnect,AccessoryConnect,ColumnWithSideBracket,TaxCost,TransferPrice,ReferencePrice,Customization,SpecialDescriptionZH,SpecialDescriptionEN,verificationCode,deleteSign,UpdateTime,CreateTime,deletePerson,CreatePerson,UpdatePerson,Remark")] T_Part_office_Column t_Part_office_Column)
 {
     if (ModelState.IsValid)
     {
         db.Entry(t_Part_office_Column).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(t_Part_office_Column));
 }
        // GET: T_Part_office_Column/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_Part_office_Column t_Part_office_Column = db.T_Part_office_Column.Find(id);

            if (t_Part_office_Column == null)
            {
                return(HttpNotFound());
            }
            return(View(t_Part_office_Column));
        }
        /// <summary>
        /// 根据mode获取
        /// </summary>
        /// <param name="mode"></param>
        /// <returns></returns>

        public T_Part_office_Column GetT_Part_office_Column(string mode, string langCode)
        {
            var query = from x in read_db.T_Part_office_Column
                        where x.Mode == mode
                        select x;


            T_Part_office_Column model = query.FirstOrDefault();

            if (model != null && model.Id > 0)
            {
                model.T_Part_office_describes = GetT_Part_office_describe(model.parametricTextIndex, langCode);
            }

            return(model);
        }
Exemple #5
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);
        }
        public object GetPartDetail(string partType, string Mode, string langCode)
        {
            string imgurl = string.Empty;
            int    parametricTextIndex        = 0;
            List <T_Part_office_describe> des = new List <T_Part_office_describe>();

            switch (partType)
            {
            case "column":
                T_Part_office_Column q4 = GetT_Part_office_Column(Mode, langCode);
                imgurl = q4.PictureName;
                parametricTextIndex = q4.parametricTextIndex;
                des = q4.T_Part_office_describes;
                break;

            case "frame":
                T_Part_office_Frame q5 = GetT_Part_office_Frame(Mode, langCode);
                imgurl = q5.PictureName;
                parametricTextIndex = q5.parametricTextIndex;
                des = q5.T_Part_office_describes;
                break;

            case "foot":
                T_Part_office_Foot q6 = GetT_Part_office_Foot(Mode, langCode);
                imgurl = q6.PictureName;
                parametricTextIndex = q6.parametricTextIndex;
                des = q6.T_Part_office_describes;
                break;

            case "SideBracket":
                T_Part_office_SideBracket q7 = GetT_Part_office_SideBracket(Mode, langCode);
                imgurl = q7.PictureName;
                parametricTextIndex = q7.parametricTextIndex;
                des = q7.T_Part_office_describes;
                break;

            case "ControlBox":
                T_Part_office_ControlBox q = GetT_Part_office_ControlBox(Mode, langCode);
                imgurl = q.PictureName;
                parametricTextIndex = q.parametricTextIndex;
                des = q.T_Part_office_describes;
                break;

            case "HandSet":
                T_Part_office_HandSet q2 = GetT_Part_office_HandSet(Mode, langCode);
                imgurl = q2.PictureName;
                parametricTextIndex = q2.parametricTextIndex;
                des = q2.T_Part_office_describes;
                break;

            case "Powercable":
                T_Part_office_Powercable q3 = GetT_Part_office_Powercable(Mode, langCode);
                imgurl = q3.PictureName;
                parametricTextIndex = q3.parametricTextIndex;
                des = q3.T_Part_office_describes;
                break;

            default:
                break;
            }

            var param = new
            {
                imgurl = imgurl,
                mode   = Mode,
                des    = des,
                parametricTextIndex = parametricTextIndex
            };

            return(param);
        }