Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public DataTable Update(string GUID, string UID, string lsid, string distypeid, string buscode, string stocode, string pdistypecode, string distypecode, string dispath, string distypename, string metcode, string fincode, string maxdiscount, string busSort, string status, string cuser, string uuser, operatelogEntity entity)
        {
            if (!CheckLogin(GUID, UID))            //非法登录
            {
                return(dtBase);
            }
            dtBase.Clear();
            string spanids   = string.Empty;
            string strReturn = CheckPageInfo("update", lsid, distypeid, buscode, stocode, pdistypecode, distypecode, dispath, distypename, metcode, fincode, maxdiscount, busSort, status, cuser, uuser, out spanids);

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

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

            //检测执行结果
            if (CheckResult(result))
            {
                //写日志
                if (entity != null)
                {
                    blllog.Add <DisheTypeEntity>(entity, Entity, OldEntity);
                }
            }
            return(dtBase);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ref DisheTypeEntity Entity)
 {
     intReturn = 0;
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@lsid",         Entity.lsid),
         new SqlParameter("@distypeid",    Entity.distypeid),
         new SqlParameter("@buscode",      Entity.buscode),
         new SqlParameter("@stocode",      Entity.stocode),
         new SqlParameter("@pdistypecode", Entity.pdistypecode),
         new SqlParameter("@distypecode",  Entity.distypecode),
         new SqlParameter("@dispath",      Entity.dispath),
         new SqlParameter("@distypename",  Entity.distypename),
         new SqlParameter("@metcode",      Entity.metcode),
         new SqlParameter("@fincode",      Entity.fincode),
         new SqlParameter("@maxdiscount",  Entity.maxdiscount),
         new SqlParameter("@busSort",      Entity.busSort),
         new SqlParameter("@status",       Entity.status),
         new SqlParameter("@cuser",        Entity.cuser),
         new SqlParameter("@uuser",        Entity.uuser),
     };
     sqlParameters[0].Direction = ParameterDirection.Output;
     intReturn = DBHelper.ExecuteNonQuery("dbo.p_DisheType_Add", CommandType.StoredProcedure, sqlParameters);
     if (intReturn == 0)
     {
         Entity.lsid = int.Parse(sqlParameters[0].Value.ToString());
     }
     return(intReturn);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 检验表单数据
        /// </summary>
        /// <returns></returns>
        public string CheckPageInfo(string type, string lsid, string distypeid, string buscode, string stocode, string pdistypecode, string distypecode, string dispath, string distypename, string metcode, string fincode, string maxdiscount, string busSort, string status, 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 <DisheTypeEntity>(EName, EValue, ref errorCode, ref ControlName, new DisheTypeEntity());
            //特殊验证写在下面

            if (errorCode.Count > 0)
            {
                strRetuen = ErrMessage.GetMessageInfoByListCode(errorCode);
                spanids   = ListTostring(ControlName);
            }
            else//组合对象数据
            {
                Entity              = new DisheTypeEntity();
                Entity.lsid         = Helper.StringToLong(lsid);
                Entity.distypeid    = Helper.StringToLong(distypeid);
                Entity.buscode      = buscode;
                Entity.stocode      = stocode;
                Entity.pdistypecode = pdistypecode;
                Entity.distypecode  = distypecode;
                Entity.dispath      = dispath;
                Entity.distypename  = distypename;
                Entity.metcode      = metcode;
                Entity.fincode      = fincode;
                Entity.maxdiscount  = Helper.StringToInt(maxdiscount);
                Entity.busSort      = Helper.StringToInt(busSort);
                Entity.status       = status;
                Entity.cuser        = Helper.StringToLong(cuser);

                Entity.uuser = Helper.StringToLong(uuser);
            }
            return(strRetuen);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(DisheTypeEntity Entity)
 {
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@lsid",         Entity.lsid),
         new SqlParameter("@distypeid",    Entity.distypeid),
         new SqlParameter("@buscode",      Entity.buscode),
         new SqlParameter("@stocode",      Entity.stocode),
         new SqlParameter("@pdistypecode", Entity.pdistypecode),
         new SqlParameter("@distypecode",  Entity.distypecode),
         new SqlParameter("@dispath",      Entity.dispath),
         new SqlParameter("@distypename",  Entity.distypename),
         new SqlParameter("@metcode",      Entity.metcode),
         new SqlParameter("@fincode",      Entity.fincode),
         new SqlParameter("@maxdiscount",  Entity.maxdiscount),
         new SqlParameter("@busSort",      Entity.busSort),
         new SqlParameter("@status",       Entity.status),
         new SqlParameter("@cuser",        Entity.cuser),
         new SqlParameter("@uuser",        Entity.uuser),
     };
     return(DBHelper.ExecuteNonQuery("dbo.p_DisheType_Update", CommandType.StoredProcedure, sqlParameters));
 }
Exemplo n.º 5
0
        /// <summary>
        /// 单行数据转实体对象
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        private DisheTypeEntity SetEntityInfo(DataRow dr)
        {
            DisheTypeEntity Entity = new DisheTypeEntity();

            Entity.lsid         = Helper.StringToLong(dr["lsid"].ToString());
            Entity.distypeid    = Helper.StringToLong(dr["distypeid"].ToString());
            Entity.buscode      = dr["buscode"].ToString();
            Entity.stocode      = dr["stocode"].ToString();
            Entity.pdistypecode = dr["pdistypecode"].ToString();
            Entity.distypecode  = dr["distypecode"].ToString();
            Entity.dispath      = dr["dispath"].ToString();
            Entity.distypename  = dr["distypename"].ToString();
            Entity.metcode      = dr["metcode"].ToString();
            Entity.fincode      = dr["fincode"].ToString();
            Entity.maxdiscount  = Helper.StringToInt(dr["maxdiscount"].ToString());
            Entity.busSort      = Helper.StringToInt(dr["busSort"].ToString());
            Entity.status       = dr["status"].ToString();
            Entity.cuser        = Helper.StringToLong(dr["cuser"].ToString());

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


            return(Entity);
        }