Esempio n. 1
0
        /// <summary>
        /// 单行数据转实体对象
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        private choorderEntity SetEntityInfo(DataRow dr)
        {
            choorderEntity Entity = new choorderEntity();

            Entity.lsid           = Helper.StringToLong(dr["lsid"].ToString());
            Entity.orderid        = Helper.StringToLong(dr["orderid"].ToString());
            Entity.buscode        = dr["buscode"].ToString();
            Entity.strcode        = dr["strcode"].ToString();
            Entity.shiftid        = Helper.StringToLong(dr["shiftid"].ToString());
            Entity.tmcode         = dr["tmcode"].ToString();
            Entity.personnum      = Helper.StringToInt(dr["personnum"].ToString());
            Entity.username       = dr["username"].ToString();
            Entity.userphone      = dr["userphone"].ToString();
            Entity.arrivetime     = dr["arrivetime"].ToString();
            Entity.opentime       = Helper.StringToDateTime(dr["opentime"].ToString());
            Entity.restime        = Helper.StringToDateTime(dr["restime"].ToString());
            Entity.checkouttime   = Helper.StringToDateTime(dr["checkouttime"].ToString());
            Entity.gusetleavetime = Helper.StringToDateTime(dr["gusetleavetime"].ToString());
            Entity.alltime        = Helper.StringToInt(dr["alltime"].ToString());
            Entity.allfoodtime    = Helper.StringToDateTime(dr["allfoodtime"].ToString());
            Entity.conmoney       = Helper.StringToDecimal(dr["conmoney"].ToString());
            Entity.status         = dr["status"].ToString();
            Entity.remark         = dr["remark"].ToString();
            Entity.cuser          = Helper.StringToLong(dr["cuser"].ToString());

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


            return(Entity);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(choorderEntity Entity)
 {
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@lsid",           Entity.lsid),
         new SqlParameter("@orderid",        Entity.orderid),
         new SqlParameter("@buscode",        Entity.buscode),
         new SqlParameter("@strcode",        Entity.strcode),
         new SqlParameter("@shiftid",        Entity.shiftid),
         new SqlParameter("@tmcode",         Entity.tmcode),
         new SqlParameter("@personnum",      Entity.personnum),
         new SqlParameter("@username",       Entity.username),
         new SqlParameter("@userphone",      Entity.userphone),
         new SqlParameter("@arrivetime",     Entity.arrivetime),
         new SqlParameter("@opentime",       Entity.opentime),
         new SqlParameter("@restime",        Entity.restime),
         new SqlParameter("@checkouttime",   Entity.checkouttime),
         new SqlParameter("@gusetleavetime", Entity.gusetleavetime),
         new SqlParameter("@alltime",        Entity.alltime),
         new SqlParameter("@allfoodtime",    Entity.allfoodtime),
         new SqlParameter("@conmoney",       Entity.conmoney),
         new SqlParameter("@status",         Entity.status),
         new SqlParameter("@remark",         Entity.remark),
         new SqlParameter("@cuser",          Entity.cuser),
         new SqlParameter("@uuser",          Entity.uuser),
     };
     return(DBHelper.ExecuteNonQuery("dbo.p_choorder_Update", CommandType.StoredProcedure, sqlParameters));
 }
Esempio n. 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public DataTable Update(string GUID, string UID, string lsid, string orderid, string buscode, string strcode, string shiftid, string tmcode, string personnum, string username, string userphone, string arrivetime, string opentime, string restime, string checkouttime, string gusetleavetime, string alltime, string allfoodtime, string conmoney, string status, string remark, string cuser, string uuser, operatelogEntity entity)
        {
            if (!CheckLogin(GUID, UID))            //非法登录
            {
                return(dtBase);
            }
            dtBase.Clear();
            string spanids   = string.Empty;
            string strReturn = CheckPageInfo("update", lsid, orderid, buscode, strcode, shiftid, tmcode, personnum, username, userphone, arrivetime, opentime, restime, checkouttime, gusetleavetime, alltime, allfoodtime, conmoney, status, remark, cuser, uuser, out spanids);

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

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

            //检测执行结果
            if (CheckResult(result))
            {
                //写日志
                if (entity != null)
                {
                    blllog.Add <choorderEntity>(entity, Entity, OldEntity);
                }
            }
            return(dtBase);
        }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ref choorderEntity Entity)
 {
     intReturn = 0;
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@lsid",           Entity.lsid),
         new SqlParameter("@orderid",        Entity.orderid),
         new SqlParameter("@buscode",        Entity.buscode),
         new SqlParameter("@strcode",        Entity.strcode),
         new SqlParameter("@shiftid",        Entity.shiftid),
         new SqlParameter("@tmcode",         Entity.tmcode),
         new SqlParameter("@personnum",      Entity.personnum),
         new SqlParameter("@username",       Entity.username),
         new SqlParameter("@userphone",      Entity.userphone),
         new SqlParameter("@arrivetime",     Entity.arrivetime),
         new SqlParameter("@opentime",       Entity.opentime),
         new SqlParameter("@restime",        Entity.restime),
         new SqlParameter("@checkouttime",   Entity.checkouttime),
         new SqlParameter("@gusetleavetime", Entity.gusetleavetime),
         new SqlParameter("@alltime",        Entity.alltime),
         new SqlParameter("@allfoodtime",    Entity.allfoodtime),
         new SqlParameter("@conmoney",       Entity.conmoney),
         new SqlParameter("@status",         Entity.status),
         new SqlParameter("@remark",         Entity.remark),
         new SqlParameter("@cuser",          Entity.cuser),
         new SqlParameter("@uuser",          Entity.uuser),
     };
     sqlParameters[0].Direction = ParameterDirection.Output;
     intReturn = DBHelper.ExecuteNonQuery("dbo.p_choorder_Add", CommandType.StoredProcedure, sqlParameters);
     if (intReturn == 0)
     {
         Entity.lsid = int.Parse(sqlParameters[0].Value.ToString());
     }
     return(intReturn);
 }
Esempio n. 5
0
        /// <summary>
        /// 检验表单数据
        /// </summary>
        /// <returns></returns>
        public string CheckPageInfo(string type, string lsid, string orderid, string buscode, string strcode, string shiftid, string tmcode, string personnum, string username, string userphone, string arrivetime, string opentime, string restime, string checkouttime, string gusetleavetime, string alltime, string allfoodtime, string conmoney, string status, string remark, 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 <choorderEntity>(EName, EValue, ref errorCode, ref ControlName, new choorderEntity());
            //特殊验证写在下面

            if (errorCode.Count > 0)
            {
                strRetuen = ErrMessage.GetMessageInfoByListCode(errorCode);
                spanids   = ListTostring(ControlName);
            }
            else//组合对象数据
            {
                Entity                = new choorderEntity();
                Entity.lsid           = Helper.StringToLong(lsid);
                Entity.orderid        = Helper.StringToLong(orderid);
                Entity.buscode        = buscode;
                Entity.strcode        = strcode;
                Entity.shiftid        = Helper.StringToLong(shiftid);
                Entity.tmcode         = tmcode;
                Entity.personnum      = Helper.StringToInt(personnum);
                Entity.username       = username;
                Entity.userphone      = userphone;
                Entity.arrivetime     = arrivetime;
                Entity.opentime       = Helper.StringToDateTime(opentime);
                Entity.restime        = Helper.StringToDateTime(restime);
                Entity.checkouttime   = Helper.StringToDateTime(checkouttime);
                Entity.gusetleavetime = Helper.StringToDateTime(gusetleavetime);
                Entity.alltime        = Helper.StringToInt(alltime);
                Entity.allfoodtime    = Helper.StringToDateTime(allfoodtime);
                Entity.conmoney       = Helper.StringToDecimal(conmoney);
                Entity.status         = status;
                Entity.remark         = remark;
                Entity.cuser          = Helper.StringToLong(cuser);

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