Beispiel #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public DataTable Update(string GUID, string UID, string lsid, string disid, string buscode, string stocode, string discode, string disname, string melcode, string disothername, string distypecode, string quickcode, string customcode, string unit, string price, string memberprice, string ismultiprice, string costprice, string iscostbyingredient, string pushmoney, string matclscode, string matcode, string extcode, string fincode, string dcode, string kitcode, string ecode, string maketime, string qrcode, string dispicture, string remark, string isentity, string entitydefcount, string entityprice, string iscanmodifyprice, string isneedweigh, string isneedmethod, string iscaninventory, string iscancustom, string iscandeposit, string isallowmemberprice, string isattachcalculate, string isclipcoupons, string iscombo, string iscombooptional, string isnonoperating, string status, string busSort, string warcode, string cuser, string uuser, operatelogEntity entity)
        {
            if (!CheckLogin(GUID, UID))            //非法登录
            {
                return(dtBase);
            }
            dtBase.Clear();
            string spanids   = string.Empty;
            string strReturn = CheckPageInfo("update", lsid, disid, buscode, stocode, discode, disname, melcode, disothername, distypecode, quickcode, customcode, unit, price, memberprice, ismultiprice, costprice, iscostbyingredient, pushmoney, matclscode, matcode, extcode, fincode, dcode, kitcode, ecode, maketime, qrcode, dispicture, remark, isentity, entitydefcount, entityprice, iscanmodifyprice, isneedweigh, isneedmethod, iscaninventory, iscancustom, iscandeposit, isallowmemberprice, isattachcalculate, isclipcoupons, iscombo, iscombooptional, isnonoperating, status, busSort, warcode, cuser, uuser, out spanids);

            //数据页面验证
            if (!CheckControl(strReturn, spanids))
            {
                return(dtBase);
            }
            //获取更新前的数据对象
            dishesEntity OldEntity = new dishesEntity();

            OldEntity = GetEntitySigInfo(" where lsid='" + lsid + "'");
            //更新数据
            int result = dal.Update(Entity);

            //检测执行结果
            if (CheckResult(result))
            {
                //写日志
                if (entity != null)
                {
                    blllog.Add <dishesEntity>(entity, Entity, OldEntity);
                }
            }
            return(dtBase);
        }
Beispiel #2
0
        /// <summary>
        /// 单行数据转实体对象
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        private dishesEntity SetEntityInfo(DataRow dr)
        {
            dishesEntity Entity = new dishesEntity();

            Entity.lsid               = Helper.StringToLong(dr["lsid"].ToString());
            Entity.disid              = Helper.StringToLong(dr["disid"].ToString());
            Entity.buscode            = dr["buscode"].ToString();
            Entity.stocode            = dr["stocode"].ToString();
            Entity.discode            = dr["discode"].ToString();
            Entity.disname            = dr["disname"].ToString();
            Entity.melcode            = dr["melcode"].ToString();
            Entity.disothername       = dr["disothername"].ToString();
            Entity.distypecode        = dr["distypecode"].ToString();
            Entity.quickcode          = dr["quickcode"].ToString();
            Entity.customcode         = dr["customcode"].ToString();
            Entity.unit               = dr["unit"].ToString();
            Entity.price              = Helper.StringToDecimal(dr["price"].ToString());
            Entity.memberprice        = Helper.StringToDecimal(dr["memberprice"].ToString());
            Entity.ismultiprice       = dr["ismultiprice"].ToString();
            Entity.costprice          = Helper.StringToDecimal(dr["costprice"].ToString());
            Entity.iscostbyingredient = dr["iscostbyingredient"].ToString();
            Entity.pushmoney          = Helper.StringToDecimal(dr["pushmoney"].ToString());
            Entity.matclscode         = dr["matclscode"].ToString();
            Entity.matcode            = dr["matcode"].ToString();
            Entity.extcode            = dr["extcode"].ToString();
            Entity.fincode            = dr["fincode"].ToString();
            Entity.dcode              = dr["dcode"].ToString();
            Entity.kitcode            = dr["kitcode"].ToString();
            Entity.ecode              = dr["ecode"].ToString();
            Entity.maketime           = Helper.StringToInt(dr["maketime"].ToString());
            Entity.qrcode             = dr["qrcode"].ToString();
            Entity.dispicture         = dr["dispicture"].ToString();
            Entity.remark             = dr["remark"].ToString();
            Entity.isentity           = dr["isentity"].ToString();
            Entity.entitydefcount     = Helper.StringToInt(dr["entitydefcount"].ToString());
            Entity.entityprice        = Helper.StringToDecimal(dr["entityprice"].ToString());
            Entity.iscanmodifyprice   = dr["iscanmodifyprice"].ToString();
            Entity.isneedweigh        = dr["isneedweigh"].ToString();
            Entity.isneedmethod       = dr["isneedmethod"].ToString();
            Entity.iscaninventory     = dr["iscaninventory"].ToString();
            Entity.iscancustom        = dr["iscancustom"].ToString();
            Entity.iscandeposit       = dr["iscandeposit"].ToString();
            Entity.isallowmemberprice = dr["isallowmemberprice"].ToString();
            Entity.isattachcalculate  = dr["isattachcalculate"].ToString();
            Entity.isclipcoupons      = dr["isclipcoupons"].ToString();
            Entity.iscombo            = dr["iscombo"].ToString();
            Entity.iscombooptional    = dr["iscombooptional"].ToString();
            Entity.isnonoperating     = dr["isnonoperating"].ToString();
            Entity.status             = dr["status"].ToString();
            Entity.busSort            = Helper.StringToInt(dr["busSort"].ToString());
            Entity.warcode            = dr["warcode"].ToString();
            Entity.cuser              = Helper.StringToLong(dr["cuser"].ToString());

            Entity.uuser = Helper.StringToLong(dr["uuser"].ToString());


            return(Entity);
        }
Beispiel #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(dishesEntity Entity)
 {
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@lsid",               Entity.lsid),
         new SqlParameter("@disid",              Entity.disid),
         new SqlParameter("@buscode",            Entity.buscode),
         new SqlParameter("@stocode",            Entity.stocode),
         new SqlParameter("@discode",            Entity.discode),
         new SqlParameter("@disname",            Entity.disname),
         new SqlParameter("@melcode",            Entity.melcode),
         new SqlParameter("@disothername",       Entity.disothername),
         new SqlParameter("@distypecode",        Entity.distypecode),
         new SqlParameter("@quickcode",          Entity.quickcode),
         new SqlParameter("@customcode",         Entity.customcode),
         new SqlParameter("@unit",               Entity.unit),
         new SqlParameter("@price",              Entity.price),
         new SqlParameter("@memberprice",        Entity.memberprice),
         new SqlParameter("@ismultiprice",       Entity.ismultiprice),
         new SqlParameter("@costprice",          Entity.costprice),
         new SqlParameter("@iscostbyingredient", Entity.iscostbyingredient),
         new SqlParameter("@pushmoney",          Entity.pushmoney),
         new SqlParameter("@matclscode",         Entity.matclscode),
         new SqlParameter("@matcode",            Entity.matcode),
         new SqlParameter("@extcode",            Entity.extcode),
         new SqlParameter("@fincode",            Entity.fincode),
         new SqlParameter("@dcode",              Entity.dcode),
         new SqlParameter("@kitcode",            Entity.kitcode),
         new SqlParameter("@ecode",              Entity.ecode),
         new SqlParameter("@maketime",           Entity.maketime),
         new SqlParameter("@qrcode",             Entity.qrcode),
         new SqlParameter("@dispicture",         Entity.dispicture),
         new SqlParameter("@remark",             Entity.remark),
         new SqlParameter("@isentity",           Entity.isentity),
         new SqlParameter("@entitydefcount",     Entity.entitydefcount),
         new SqlParameter("@entityprice",        Entity.entityprice),
         new SqlParameter("@iscanmodifyprice",   Entity.iscanmodifyprice),
         new SqlParameter("@isneedweigh",        Entity.isneedweigh),
         new SqlParameter("@isneedmethod",       Entity.isneedmethod),
         new SqlParameter("@iscaninventory",     Entity.iscaninventory),
         new SqlParameter("@iscancustom",        Entity.iscancustom),
         new SqlParameter("@iscandeposit",       Entity.iscandeposit),
         new SqlParameter("@isallowmemberprice", Entity.isallowmemberprice),
         new SqlParameter("@isattachcalculate",  Entity.isattachcalculate),
         new SqlParameter("@isclipcoupons",      Entity.isclipcoupons),
         new SqlParameter("@iscombo",            Entity.iscombo),
         new SqlParameter("@iscombooptional",    Entity.iscombooptional),
         new SqlParameter("@isnonoperating",     Entity.isnonoperating),
         new SqlParameter("@status",             Entity.status),
         new SqlParameter("@busSort",            Entity.busSort),
         new SqlParameter("@warcode",            Entity.warcode),
         new SqlParameter("@cuser",              Entity.cuser),
         new SqlParameter("@uuser",              Entity.uuser),
     };
     return(DBHelper.ExecuteNonQuery("dbo.p_dishes_Update", CommandType.StoredProcedure, sqlParameters));
 }
Beispiel #4
0
        /// <summary>
        /// 检验表单数据
        /// </summary>
        /// <returns></returns>
        public string CheckPageInfo(string type, string lsid, string disid, string buscode, string stocode, string discode, string disname, string melcode, string disothername, string distypecode, string quickcode, string customcode, string unit, string price, string memberprice, string ismultiprice, string costprice, string iscostbyingredient, string pushmoney, string matclscode, string matcode, string extcode, string fincode, string dcode, string kitcode, string ecode, string maketime, string qrcode, string dispicture, string remark, string isentity, string entitydefcount, string entityprice, string iscanmodifyprice, string isneedweigh, string isneedmethod, string iscaninventory, string iscancustom, string iscandeposit, string isallowmemberprice, string isattachcalculate, string isclipcoupons, string iscombo, string iscombooptional, string isnonoperating, string status, string busSort, string warcode, string cuser, string uuser, out string spanids)
        {
            string strRetuen = string.Empty;

            spanids = string.Empty;
            //要验证的实体属性
            List <string> EName = new List <string>()
            {
            };
            //要验证的实体属性值
            List <string> EValue = new List <string>()
            {
            };
            //错误信息
            List <string> errorCode   = new List <string>();
            List <string> ControlName = new List <string>();

            //验证数据
            CheckValue <dishesEntity>(EName, EValue, ref errorCode, ref ControlName, new dishesEntity());
            //特殊验证写在下面

            if (errorCode.Count > 0)
            {
                strRetuen = ErrMessage.GetMessageInfoByListCode(errorCode);
                spanids   = ListTostring(ControlName);
            }
            else//组合对象数据
            {
                Entity                    = new dishesEntity();
                Entity.lsid               = Helper.StringToLong(lsid);
                Entity.disid              = Helper.StringToLong(disid);
                Entity.buscode            = buscode;
                Entity.stocode            = stocode;
                Entity.discode            = discode;
                Entity.disname            = disname;
                Entity.melcode            = melcode;
                Entity.disothername       = disothername;
                Entity.distypecode        = distypecode;
                Entity.quickcode          = quickcode;
                Entity.customcode         = customcode;
                Entity.unit               = unit;
                Entity.price              = Helper.StringToDecimal(price);
                Entity.memberprice        = Helper.StringToDecimal(memberprice);
                Entity.ismultiprice       = ismultiprice;
                Entity.costprice          = Helper.StringToDecimal(costprice);
                Entity.iscostbyingredient = iscostbyingredient;
                Entity.pushmoney          = Helper.StringToDecimal(pushmoney);
                Entity.matclscode         = matclscode;
                Entity.matcode            = matcode;
                Entity.extcode            = extcode;
                Entity.fincode            = fincode;
                Entity.dcode              = dcode;
                Entity.kitcode            = kitcode;
                Entity.ecode              = ecode;
                Entity.maketime           = Helper.StringToInt(maketime);
                Entity.qrcode             = qrcode;
                Entity.dispicture         = dispicture;
                Entity.remark             = remark;
                Entity.isentity           = isentity;
                Entity.entitydefcount     = Helper.StringToInt(entitydefcount);
                Entity.entityprice        = Helper.StringToDecimal(entityprice);
                Entity.iscanmodifyprice   = iscanmodifyprice;
                Entity.isneedweigh        = isneedweigh;
                Entity.isneedmethod       = isneedmethod;
                Entity.iscaninventory     = iscaninventory;
                Entity.iscancustom        = iscancustom;
                Entity.iscandeposit       = iscandeposit;
                Entity.isallowmemberprice = isallowmemberprice;
                Entity.isattachcalculate  = isattachcalculate;
                Entity.isclipcoupons      = isclipcoupons;
                Entity.iscombo            = iscombo;
                Entity.iscombooptional    = iscombooptional;
                Entity.isnonoperating     = isnonoperating;
                Entity.status             = status;
                Entity.busSort            = Helper.StringToInt(busSort);
                Entity.warcode            = warcode;
                Entity.cuser              = Helper.StringToLong(cuser);

                Entity.uuser = Helper.StringToLong(uuser);
            }
            return(strRetuen);
        }