コード例 #1
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_dailyLog>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_dailyLog.Find(form.code);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_dailyLog.Add(form);
                }
                else
                {
                    dbForm.UserCode     = form.UserCode;
                    dbForm.AttDateTime  = form.AttDateTime;
                    dbForm.DailySummary = form.DailySummary;
                    dbForm.DailyPlan    = form.DailyPlan;
                    dbForm.DailyExper   = form.DailyExper;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #2
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_diningcustomers>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_diningcustomers.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_diningcustomers.Add(form);
                }
                else
                {
                    dbForm.DealerCode         = form.DealerCode;
                    dbForm.DealerType         = form.DealerType;
                    dbForm.attendance         = form.attendance;
                    dbForm.averageconsumption = form.averageconsumption;
                    dbForm.shoptype           = form.shoptype;
                    dbForm.between_number     = form.between_number;
                    dbForm.Remark             = form.Remark;
                    dbForm.UpdateDate         = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson       = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #3
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <HR_Employees>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.HR_Employees.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.HR_Employees.Add(form);
                }
                else
                {
                    dbForm.Code       = form.Code;
                    dbForm.FName      = form.FName;
                    dbForm.Sex        = form.Sex;
                    dbForm.Nation     = form.Nation;
                    dbForm.Mobile     = form.Mobile;
                    dbForm.IDCardNo   = form.IDCardNo;
                    dbForm.Department = form.Department;
                    dbForm.FStatus    = form.FStatus;
                    dbForm.Type       = form.Type;
                    dbForm.CustID     = form.CustID;
                    dbForm.Remark     = form.Remark;
                    dbForm.UpdateDate = form.UpdateDate = DateTime.Now;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #4
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <fw_directprice>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.fw_directprice.Find(form.directid);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.fw_directprice.Add(form);
                }
                else
                {
                    dbForm.directtitle  = form.directtitle;
                    dbForm.catid0       = form.catid0;
                    dbForm.directtime0  = form.directtime0;
                    dbForm.directprice0 = form.directprice0;
                    dbForm.isshow       = form.isshow;
                    dbForm.floatprice0  = form.floatprice0;
                    dbForm.floatrate0   = form.floatrate0;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #5
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_goodsreport>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_goodsreport.Find(form.RPdtCode);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_goodsreport.Add(form);
                }
                else
                {
                    dbForm.UserCode     = form.UserCode;
                    dbForm.PrmDate      = form.PrmDate;
                    dbForm.DealerCode   = form.DealerCode;
                    dbForm.Remark       = form.Remark;
                    dbForm.Pic1         = form.Pic1;
                    dbForm.Pic2         = form.Pic2;
                    dbForm.Pic3         = form.Pic3;
                    dbForm.Pic4         = form.Pic4;
                    dbForm.Pic5         = form.Pic5;
                    dbForm.Pic6         = form.Pic6;
                    dbForm.Pic7         = form.Pic7;
                    dbForm.Pic8         = form.Pic8;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #6
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <PrepaidTax>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.PrepaidTax.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.PrepaidTax.Add(form);
                }
                else
                {
                    dbForm.Code          = form.Code;
                    dbForm.Corp          = form.Corp;
                    dbForm.CustID        = form.CustID;
                    dbForm.Invoice       = form.Invoice;
                    dbForm.Amt           = form.Amt;
                    dbForm.DeductibleAmt = form.DeductibleAmt;
                    dbForm.ReceiptDate   = form.ReceiptDate;
                    dbForm.InvoicesRise  = form.InvoicesRise;
                    dbForm.UpdateDate    = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson  = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #7
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <treetest>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.treetest.Find(form.OrganizeCode);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.treetest.Add(form);
                }
                else
                {
                    dbForm.ParentCode   = form.ParentCode;
                    dbForm.ParentCode_N = form.ParentCode_N;
                    dbForm.OrganizeSeq  = form.OrganizeSeq;
                    dbForm.OrganizeName = form.OrganizeName;
                    dbForm.Description  = form.Description;
                    dbForm.CompCode     = form.CompCode;
                    dbForm.N_Code       = form.N_Code;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #8
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_patrolSet>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_patrolSet.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_patrolSet.Add(form);
                }
                else
                {
                    dbForm.RoleCode      = form.RoleCode;
                    dbForm.SignInMode    = form.SignInMode;
                    dbForm.SignOutMode   = form.SignOutMode;
                    dbForm.SignInRange   = form.SignInRange;
                    dbForm.SignOutRange  = form.SignOutRange;
                    dbForm.PhotoMarkType = form.PhotoMarkType;
                    dbForm.PhotoRatio    = form.PhotoRatio;
                    dbForm.UpdateDate    = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson  = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #9
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <BD_Department>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.BD_Department.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.BD_Department.Add(form);
                }
                else
                {
                    dbForm.FCode        = form.FCode;
                    dbForm.FName        = form.FName;
                    dbForm.Remark       = form.Remark;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #10
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <PM_ContractFiles>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.PM_ContractFiles.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.PM_ContractFiles.Add(form);
                }
                else
                {
                    dbForm.PManager    = form.PManager;
                    dbForm.type        = form.type;
                    dbForm.PID         = form.PID;
                    dbForm.Amt         = form.Amt;
                    dbForm.Owner       = form.Owner;
                    dbForm.ProjName    = form.ProjName;
                    dbForm.BeginDate   = form.BeginDate;
                    dbForm.EndDate     = form.EndDate;
                    dbForm.projAddress = form.projAddress;
                    dbForm.Remark      = form.Remark;
                    dbForm.Attach      = form.Attach;
                    dbForm.UpdateDate  = form.UpdateDate = DateTime.Now;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #11
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <FA_InvAccepts>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.FA_InvAccepts.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.FA_InvAccepts.Add(form);
                }
                else
                {
                    dbForm.Corp         = form.Corp;
                    dbForm.CustID       = form.CustID;
                    dbForm.PID          = form.PID;
                    dbForm.Fdate        = form.Fdate;
                    dbForm.Amt          = form.Amt;
                    dbForm.invoiceTitle = form.invoiceTitle;
                    dbForm.invoiceType  = form.invoiceType;
                    dbForm.Remark       = form.Remark;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #12
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <timingSet>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.timingSet.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    db.timingSet.Add(form);
                }
                else
                {
                    dbForm.RoleCode    = form.RoleCode;
                    dbForm.psncode     = form.psncode;
                    dbForm.timingtype  = form.timingtype;
                    dbForm.interval    = form.interval;
                    dbForm.mobegintime = form.mobegintime;
                    dbForm.moendtime   = form.moendtime;
                    dbForm.afbegintime = form.afbegintime;
                    dbForm.afendtime   = form.afendtime;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #13
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_businesscustomers>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_businesscustomers.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_businesscustomers.Add(form);
                }
                else
                {
                    dbForm.DealerCode      = form.DealerCode;
                    dbForm.DealerType      = form.DealerType;
                    dbForm.Businessarea    = form.Businessarea;
                    dbForm.Procurementmode = form.Procurementmode;
                    dbForm.Remark          = form.Remark;
                    dbForm.UpdateDate      = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson    = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #14
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <HR_CertLoans>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.HR_CertLoans.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.HR_CertLoans.Add(form);
                }
                else
                {
                    dbForm.CID        = form.CID;
                    dbForm.Department = form.Department;
                    dbForm.GAddress   = form.GAddress;
                    dbForm.ProjName   = form.ProjName;
                    dbForm.Amt        = form.Amt;
                    dbForm.loanDate   = form.loanDate;
                    dbForm.EndTime    = form.EndTime;
                    dbForm.KAmt       = form.KAmt;
                    dbForm.TRemark    = form.TRemark;
                    dbForm.DRemark    = form.DRemark;
                    dbForm.Scan       = form.Scan;
                    dbForm.UpdateDate = form.UpdateDate = DateTime.Now;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #15
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_distributionclient>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_distributionclient.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_distributionclient.Add(form);
                }
                else
                {
                    dbForm.DealerCode       = form.DealerCode;
                    dbForm.DealerType       = form.DealerType;
                    dbForm.Businessarea     = form.Businessarea;
                    dbForm.Appearancenumber = form.Appearancenumber;
                    dbForm.Winecapacity     = form.Winecapacity;
                    dbForm.jkfs             = form.jkfs;
                    dbForm.Remark           = form.Remark;
                    dbForm.UpdateDate       = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson     = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #16
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <HR_SocialSecuritySets>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.HR_SocialSecuritySets.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.HR_SocialSecuritySets.Add(form);
                }
                else
                {
                    dbForm.pIndvPension      = form.pIndvPension;
                    dbForm.pIndvMedical      = form.pIndvMedical;
                    dbForm.pIndvUnemploy     = form.pIndvUnemploy;
                    dbForm.pCorpPension      = form.pCorpPension;
                    dbForm.pCorpBaseMedical  = form.pCorpBaseMedical;
                    dbForm.pCorpLocalMedical = form.pCorpLocalMedical;
                    dbForm.pCorpInjury       = form.pCorpInjury;
                    dbForm.pCorpBirth        = form.pCorpBirth;
                    dbForm.pCorpUnemploy     = form.pCorpUnemploy;
                    dbForm.FType             = form.FType;
                    dbForm.Remark            = form.Remark;
                    dbForm.UpdateDate        = form.UpdateDate = DateTime.Now;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #17
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <EnterpriseCertificate>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.EnterpriseCertificate.Find(form.FID);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.EnterpriseCertificate.Add(form);
                }
                else
                {
                    dbForm.Company       = form.Company;
                    dbForm.Name          = form.Name;
                    dbForm.EffectiveDate = form.EffectiveDate;
                    dbForm.Qty           = form.Qty;
                    dbForm.onProject     = form.onProject;
                    dbForm.UpdateDate    = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson  = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #18
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_income>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_income.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_income.Add(form);
                }
                else
                {
                    dbForm.PopCode      = form.PopCode;
                    dbForm.Month        = form.Month;
                    dbForm.IncomeAmt    = form.IncomeAmt;
                    dbForm.UserCode     = form.UserCode;
                    dbForm.Remark       = form.Remark;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #19
0
ファイル: OverdueController.Build.cs プロジェクト: zhgl7688/-
        public object Post(JArray post)
        {
            using (var db = new LUOLAI1401Context())
            {
                for (var i = 0; i < post.Count; i++)
                {
                    var      form     = post[i].ToObject <PM_Overdue>(JsonExtension.FixJsonSerializer);
                    var      dbForm   = db.PM_Overdue.Find(form.FID);
                    RowState rowState = (RowState)(int)post[i]["_row_state"];
                    switch (rowState)
                    {
                    case RowState.Changed:
                        dbForm.CustID = form.CustID;
                        dbForm.Amt    = form.Amt;
                        break;

                    case RowState.Deleted:
                        db.Entry(dbForm).State = System.Data.Entity.EntityState.Deleted;
                        break;

                    case RowState.New:
                        form.FID = int.Parse((string)NewFID());
                        db.PM_Overdue.Add(form);
                        break;
                    }
                }
                db.SaveChanges();
                return(true);
            }
        }
コード例 #20
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_attendSet>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_attendSet.Find(form.id);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.wq_attendSet.Add(form);
                }
                else
                {
                    dbForm.RoleCode     = form.RoleCode;
                    dbForm.BgnTimeAM    = form.BgnTimeAM;
                    dbForm.EndTimeAM    = form.EndTimeAM;
                    dbForm.BgnTimePM    = form.BgnTimePM;
                    dbForm.EndTimePM    = form.EndTimePM;
                    dbForm.AttPhotoFlag = form.AttPhotoFlag;
                    dbForm.iswatermark  = form.iswatermark;
                    dbForm.isresolution = form.isresolution;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #21
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <fw_userinfo>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.fw_userinfo.Find(form.userid);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.fw_userinfo.Add(form);
                }
                else
                {
                    dbForm.username     = form.username;
                    dbForm.userpass     = form.userpass;
                    dbForm.regtime      = form.regtime;
                    dbForm.lasttime     = form.lasttime;
                    dbForm.isadmin      = form.isadmin;
                    dbForm.isenabled    = form.isenabled;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #22
0
        public object Post(JArray post)
        {
            using (var db = new LUOLAI1401Context())
            {
                for (var i = 0; i < post.Count; i++)
                {
                    var      form     = post[i].ToObject <fw_Direct>(JsonExtension.FixJsonSerializer);
                    var      dbForm   = db.fw_Direct.Find(form.dirid);
                    RowState rowState = (RowState)(int)post[i]["_row_state"];
                    switch (rowState)
                    {
                    case RowState.Changed:
                        dbForm.item     = form.item;
                        dbForm.corpname = form.corpname;
                        dbForm.dirname  = form.dirname;
                        dbForm.dirvalue = form.dirvalue;
                        dbForm.UpValue  = form.UpValue;
                        break;

                    case RowState.Deleted:
                        db.Entry(dbForm).State = System.Data.Entity.EntityState.Deleted;
                        break;

                    case RowState.New:
                        form.dirid = (string)Newdirid();
                        db.fw_Direct.Add(form);
                        break;
                    }
                }
                db.SaveChanges();
                return(true);
            }
        }
コード例 #23
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <base_productCate>();

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.base_productCate.Find(form.CateCode);
                if (dbForm == null)
                {
                    form.CompCode     = string.Format("{0}", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode);
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.base_productCate.Add(form);
                }
                else
                {
                    dbForm.CateName     = form.CateName;
                    dbForm.DelFlag      = form.DelFlag;
                    dbForm.UpdateDate   = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #24
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <fw_messageinfo>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.fw_messageinfo.Find(form.messid);
                if (dbForm == null)
                {
                    form.CreateDate   = DateTime.Now;
                    form.CreatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                    db.fw_messageinfo.Add(form);
                }
                else
                {
                    dbForm.title         = form.title;
                    dbForm.fromid        = form.fromid;
                    dbForm.toid          = form.toid;
                    dbForm.attachmenturl = form.attachmenturl;
                    dbForm.isread        = form.isread;
                    dbForm.messcontent   = form.messcontent;
                    dbForm.isdelete      = form.isdelete;
                    dbForm.UpdateDate    = form.UpdateDate = DateTime.Now;
                    dbForm.UpdatePerson  = form.UpdatePerson = (HttpContext.Current.Session["sys_user"] as sys_user).UserName;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #25
0
 public object Delete(string id)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.base_productCate.Remove(r => r.CateCode == id);
         db.SaveChanges();
     }
     return(true);
 }
コード例 #26
0
        public object Post(JObject post)
        {
            var form = post["form"].ToObject <wq_termPop>(JsonExtension.FixJsonSerializer);

            using (var db = new LUOLAI1401Context())
            {
                var dbForm = db.wq_termPop.Find(form.PopCode);
                if (dbForm == null)
                {
                    db.wq_termPop.Add(form);
                }
                else
                {
                    dbForm.PopName  = form.PopName;
                    dbForm.Address  = form.Address;
                    dbForm.Contact1 = form.Contact1;
                    dbForm.Tel1     = form.Tel1;
                    dbForm.Mobile1  = form.Mobile1;
                    dbForm.Contact2 = form.Contact2;
                    dbForm.Tel2     = form.Tel2;
                    dbForm.Mobile2  = form.Mobile2;
                }
                // 记录多级零时主键对应(key int 为 js 生成的页内全局唯一编号)
                var _id_maps = new Dictionary <int, object[]>();
                if (post["wq_Pop_Dealer"] != null)
                {
                    var sub = post["wq_Pop_Dealer"] as JArray;
                    if (sub.Count > 0)
                    {
                        for (int i = 0; i < sub.Count; i++)
                        {
                            JObject  obj      = sub[i] as JObject;
                            RowState rowState = (RowState)(int)obj["_row_state"];
                            var      model    = obj.ToObject <wq_Pop_Dealer>(JsonExtension.FixJsonSerializer);
                            switch (rowState)
                            {
                            case RowState.Changed:
                                db.Entry(model).State = System.Data.Entity.EntityState.Modified;
                                break;

                            case RowState.New:
                                model.PopCode = form.PopCode;
                                model.id      = new SysSerialServices().GetNewSerial("wq_Pop_Dealer." + form.PopCode, null);
                                db.wq_Pop_Dealer.Add(model);
                                break;

                            case RowState.Deleted:
                                db.Entry(model).State = System.Data.Entity.EntityState.Deleted;
                                break;
                            }
                        }
                    }
                }
                db.SaveChanges();
            }
            return(new { success = true, form = form });
        }
コード例 #27
0
 public object Delete(string id)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.wq_termPop.Remove(r => r.CompCode == id);
         db.SaveChanges();
     }
     return(true);
 }
コード例 #28
0
 public object Delete(string id)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.wq_patrolSet.Remove(r => r.id == id);
         db.SaveChanges();
     }
     return(true);
 }
コード例 #29
0
ファイル: LogController.Build.cs プロジェクト: zhgl7688/-
 public object Delete(int id)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.log.Remove(r => r.id == id);
         db.SaveChanges();
     }
     return(true);
 }
コード例 #30
0
ファイル: DeltestController.Build.cs プロジェクト: zhgl7688/-
 public object Delete(string id)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.a.Remove(r => r.id == Guid.Parse(id));
         db.SaveChanges();
     }
     return(true);
 }