Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public DataTable Update(string GUID, string UID, string bwid, string serialNumber, string buscode, string strcode, string busTop, string sortNum, string busDate, string waitType, string userName, string tel, string waitTime, string remark, string status, string cuser, string uuser, string openid, operatelogEntity entity)
        {
            if (!CheckLogin(GUID, UID))//非法登录
            {
                return(dtBase);
            }
            dtBase.Clear();
            string spanids   = string.Empty;
            string strReturn = CheckPageInfo("update", bwid, serialNumber, buscode, strcode, busTop, sortNum, busDate, waitType, userName, tel, waitTime, remark, status, cuser, uuser, openid, out spanids);

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

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

            //检测执行结果
            if (CheckResult(result))
            {
                //写日志
                if (entity != null)
                {
                    blllog.Add <WX_busWaitEntity>(entity, Entity, OldEntity);
                }
            }
            return(dtBase);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ref WX_busWaitEntity Entity)
 {
     intReturn = 0;
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@bwid",         Entity.bwid),
         new SqlParameter("@serialNumber", Entity.serialNumber),
         new SqlParameter("@buscode",      Entity.buscode),
         new SqlParameter("@strcode",      Entity.strcode),
         new SqlParameter("@busTop",       Entity.busTop),
         new SqlParameter("@sortNum",      Entity.sortNum),
         new SqlParameter("@busDate",      Entity.busDate),
         new SqlParameter("@waitType",     Entity.waitType),
         new SqlParameter("@userName",     Entity.userName),
         new SqlParameter("@tel",          Entity.tel),
         new SqlParameter("@waitTime",     Entity.waitTime),
         new SqlParameter("@remark",       Entity.remark),
         new SqlParameter("@status",       Entity.status),
         new SqlParameter("@cuser",        Entity.cuser),
         new SqlParameter("@uuser",        Entity.uuser),
         new SqlParameter("@openid",       Entity.openid),
     };
     sqlParameters[0].Direction = ParameterDirection.Output;
     intReturn = DBHelper.ExecuteNonQuery("dbo.p_WX_busWait_Add", CommandType.StoredProcedure, sqlParameters);
     if (intReturn == 0)
     {
         Entity.bwid = int.Parse(sqlParameters[0].Value.ToString());
     }
     return(intReturn);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 检验表单数据
        /// </summary>
        /// <returns></returns>
        public string CheckPageInfo(string type, string bwid, string serialNumber, string buscode, string strcode, string busTop, string sortNum, string busDate, string waitType, string userName, string tel, string waitTime, string remark, string status, string cuser, string uuser, string openid, 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 <WX_busWaitEntity>(EName, EValue, ref errorCode, ref ControlName, new WX_busWaitEntity());
            //特殊验证写在下面

            if (errorCode.Count > 0)
            {
                strRetuen = ErrMessage.GetMessageInfoByListCode(errorCode);
                spanids   = ListTostring(ControlName);
            }
            else//组合对象数据
            {
                Entity              = new WX_busWaitEntity();
                Entity.bwid         = Helper.StringToLong(bwid);
                Entity.serialNumber = serialNumber;
                Entity.buscode      = buscode;
                Entity.strcode      = strcode;
                Entity.busTop       = Helper.StringToInt(busTop);
                Entity.sortNum      = sortNum;
                Entity.busDate      = Helper.StringToDateTime(busDate);
                Entity.waitType     = waitType;
                Entity.userName     = userName;
                Entity.tel          = tel;
                Entity.waitTime     = Helper.StringToDateTime(waitTime);
                Entity.remark       = remark;
                Entity.status       = status;
                Entity.cuser        = Helper.StringToLong(cuser);

                Entity.uuser = Helper.StringToLong(uuser);


                Entity.openid = openid;
            }
            return(strRetuen);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 单行数据转实体对象
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        private WX_busWaitEntity SetEntityInfo(DataRow dr)
        {
            WX_busWaitEntity Entity = new WX_busWaitEntity();

            Entity.bwid         = Helper.StringToLong(dr["bwid"].ToString());
            Entity.serialNumber = dr["serialNumber"].ToString();
            Entity.buscode      = dr["buscode"].ToString();
            Entity.strcode      = dr["strcode"].ToString();
            Entity.busTop       = Helper.StringToInt(dr["busTop"].ToString());
            Entity.sortNum      = dr["sortNum"].ToString();
            Entity.busDate      = Helper.StringToDateTime(dr["busDate"].ToString());
            Entity.waitType     = dr["waitType"].ToString();
            Entity.userName     = dr["userName"].ToString();
            Entity.tel          = dr["tel"].ToString();
            Entity.waitTime     = Helper.StringToDateTime(dr["waitTime"].ToString());
            Entity.remark       = dr["remark"].ToString();
            Entity.status       = dr["status"].ToString();
            Entity.cuser        = Helper.StringToLong(dr["cuser"].ToString());
            Entity.uuser        = Helper.StringToLong(dr["uuser"].ToString());
            Entity.openid       = dr["openid"].ToString();
            return(Entity);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(WX_busWaitEntity Entity)
 {
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@bwid",         Entity.bwid),
         new SqlParameter("@serialNumber", Entity.serialNumber),
         new SqlParameter("@buscode",      Entity.buscode),
         new SqlParameter("@strcode",      Entity.strcode),
         new SqlParameter("@busTop",       Entity.busTop),
         new SqlParameter("@sortNum",      Entity.sortNum),
         new SqlParameter("@busDate",      Entity.busDate),
         new SqlParameter("@waitType",     Entity.waitType),
         new SqlParameter("@userName",     Entity.userName),
         new SqlParameter("@tel",          Entity.tel),
         new SqlParameter("@waitTime",     Entity.waitTime),
         new SqlParameter("@remark",       Entity.remark),
         new SqlParameter("@status",       Entity.status),
         new SqlParameter("@cuser",        Entity.cuser),
         new SqlParameter("@uuser",        Entity.uuser),
         new SqlParameter("@openid",       Entity.openid),
     };
     return(DBHelper.ExecuteNonQuery("dbo.p_WX_busWait_Update", CommandType.StoredProcedure, sqlParameters));
 }