Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("express_log_list", "打印清单列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            key    = RequestTool.RequestString("key");
            Status = RequestTool.RequestString("Status");
            id     = RequestTool.RequestInt("id", 0);
            Tid    = RequestTool.RequestInt("Tid", 0);
            Lebi_Express_Log modellog = B_Lebi_Express_Log.GetModel(id);

            Transport_Name = modellog.Transport_Name;
            PageSize       = RequestTool.getpageSize(25);
            string where   = "Express_Log_Id = " + id;
            if (key != "")
            {
                where += " and (Order_Code like lbsql{'%" + key + "%'} or Order_Id in (select Transport_Name from [Lebi_Order] where id = Order_Id and Transport_Name like lbsql{'%" + key + "%'}))";
            }
            if (Status != "")
            {
                where += " and Status = " + Status;
            }
            models = B_Lebi_Express_LogList.GetList(where, "id desc", PageSize, page);
            int recordCount = B_Lebi_Express_LogList.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&Tid=" + Tid + "&id=" + id + "&Status=" + Status + "&key=" + key, page, PageSize, recordCount);
        }
Beispiel #2
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_Express_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_Express_Log] set ");
                strSql.Append("[Number]=@Number,");
                strSql.Append("[Time_Add]=@Time_Add,");
                strSql.Append("[Status]=@Status,");
                strSql.Append("[IdList]=@IdList,");
                strSql.Append("[Transport_id]=@Transport_id,");
                strSql.Append("[Transport_Name]=@Transport_Name,");
                strSql.Append("[Supplier_id]=@Supplier_id");
                strSql.Append(" where id=" + model.id);
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Number",         model.Number),
                    new OleDbParameter("@Time_Add",       model.Time_Add.ToString("yyyy-MM-dd HH:mm:ss")),
                    new OleDbParameter("@Status",         model.Status),
                    new OleDbParameter("@IdList",         model.IdList),
                    new OleDbParameter("@Transport_id",   model.Transport_id),
                    new OleDbParameter("@Transport_Name", model.Transport_Name),
                    new OleDbParameter("@Supplier_id",    model.Supplier_id)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
Beispiel #3
0
            /// <summary>
            /// 对象实体绑定数据
            /// </summary>
            public Lebi_Express_Log ReaderBind(IDataReader dataReader)
            {
                Lebi_Express_Log model = new Lebi_Express_Log();
                object           ojb;

                ojb = dataReader["id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.id = (int)ojb;
                }
                model.Number = dataReader["Number"].ToString();
                ojb          = dataReader["Time_Add"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Time_Add = (DateTime)ojb;
                }
                ojb = dataReader["Status"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Status = (int)ojb;
                }
                model.IdList = dataReader["IdList"].ToString();
                ojb          = dataReader["Transport_id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Transport_id = (int)ojb;
                }
                model.Transport_Name = dataReader["Transport_Name"].ToString();
                ojb = dataReader["Supplier_id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Supplier_id = (int)ojb;
                }
                return(model);
            }
Beispiel #4
0
 /// <summary>
 /// 安全方式绑定对象表单
 /// </summary>
 public Lebi_Express_Log SafeBindForm(Lebi_Express_Log model)
 {
     if (HttpContext.Current.Request["Number"] != null)
     {
         model.Number = Shop.Tools.RequestTool.RequestSafeString("Number");
     }
     if (HttpContext.Current.Request["Time_Add"] != null)
     {
         model.Time_Add = Shop.Tools.RequestTool.RequestTime("Time_Add", System.DateTime.Now);
     }
     if (HttpContext.Current.Request["Status"] != null)
     {
         model.Status = Shop.Tools.RequestTool.RequestInt("Status", 0);
     }
     if (HttpContext.Current.Request["IdList"] != null)
     {
         model.IdList = Shop.Tools.RequestTool.RequestSafeString("IdList");
     }
     if (HttpContext.Current.Request["Transport_id"] != null)
     {
         model.Transport_id = Shop.Tools.RequestTool.RequestInt("Transport_id", 0);
     }
     if (HttpContext.Current.Request["Transport_Name"] != null)
     {
         model.Transport_Name = Shop.Tools.RequestTool.RequestSafeString("Transport_Name");
     }
     if (HttpContext.Current.Request["Supplier_id"] != null)
     {
         model.Supplier_id = Shop.Tools.RequestTool.RequestInt("Supplier_id", 0);
     }
     return(model);
 }
Beispiel #5
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_Express_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_Express_Log] set ");
                strSql.Append("Number= @Number,");
                strSql.Append("Time_Add= @Time_Add,");
                strSql.Append("Status= @Status,");
                strSql.Append("IdList= @IdList,");
                strSql.Append("Transport_id= @Transport_id,");
                strSql.Append("Transport_Name= @Transport_Name,");
                strSql.Append("Supplier_id= @Supplier_id");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id",             SqlDbType.Int,         4),
                    new SqlParameter("@Number",         SqlDbType.NVarChar,   20),
                    new SqlParameter("@Time_Add",       SqlDbType.DateTime),
                    new SqlParameter("@Status",         SqlDbType.Int,         4),
                    new SqlParameter("@IdList",         SqlDbType.NVarChar,  255),
                    new SqlParameter("@Transport_id",   SqlDbType.Int,         4),
                    new SqlParameter("@Transport_Name", SqlDbType.NVarChar,  100),
                    new SqlParameter("@Supplier_id",    SqlDbType.Int, 4)
                };
                parameters[0].Value = model.id;
                parameters[1].Value = model.Number;
                parameters[2].Value = model.Time_Add;
                parameters[3].Value = model.Status;
                parameters[4].Value = model.IdList;
                parameters[5].Value = model.Transport_id;
                parameters[6].Value = model.Transport_Name;
                parameters[7].Value = model.Supplier_id;

                SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
Beispiel #6
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_Express_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_Express_Log](");
                strSql.Append("Number,Time_Add,Status,IdList,Transport_id,Transport_Name,Supplier_id)");
                strSql.Append(" values (");
                strSql.Append("@Number,@Time_Add,@Status,@IdList,@Transport_id,@Transport_Name,@Supplier_id)");
                strSql.Append(";select @@IDENTITY");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@Number",         model.Number),
                    new SqlParameter("@Time_Add",       model.Time_Add),
                    new SqlParameter("@Status",         model.Status),
                    new SqlParameter("@IdList",         model.IdList),
                    new SqlParameter("@Transport_id",   model.Transport_id),
                    new SqlParameter("@Transport_Name", model.Transport_Name),
                    new SqlParameter("@Supplier_id",    model.Supplier_id)
                };

                object obj = SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters);

                if (obj == null)
                {
                    return(1);
                }
                else
                {
                    return(Convert.ToInt32(obj));
                }
            }
Beispiel #7
0
            /// <summary>
            /// 得到一个对象实体 by id
            /// </summary>
            public Lebi_Express_Log GetModel(int id)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("select  top 1  * from [Lebi_Express_Log] ");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id", SqlDbType.Int, 4)
                };
                parameters[0].Value = id;

                Lebi_Express_Log model = new Lebi_Express_Log();
                DataSet          ds    = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString(), parameters);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                    {
                        model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                    }
                    model.Number = ds.Tables[0].Rows[0]["Number"].ToString();
                    if (ds.Tables[0].Rows[0]["Time_Add"].ToString() != "")
                    {
                        model.Time_Add = DateTime.Parse(ds.Tables[0].Rows[0]["Time_Add"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(ds.Tables[0].Rows[0]["Status"].ToString());
                    }
                    model.IdList = ds.Tables[0].Rows[0]["IdList"].ToString();
                    if (ds.Tables[0].Rows[0]["Transport_id"].ToString() != "")
                    {
                        model.Transport_id = int.Parse(ds.Tables[0].Rows[0]["Transport_id"].ToString());
                    }
                    model.Transport_Name = ds.Tables[0].Rows[0]["Transport_Name"].ToString();
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
Beispiel #8
0
            /// <summary>
            /// 得到一个对象实体 by where条件
            /// </summary>
            public Lebi_Express_Log GetModel(string strWhere)
            {
                if (strWhere.IndexOf("lbsql{") > 0)
                {
                    SQLPara para = new SQLPara(strWhere, "", "");
                    return(GetModel(para));
                }
                StringBuilder strSql = new StringBuilder();

                strSql.Append("select  top 1  * from [Lebi_Express_Log] ");
                strSql.Append(" where " + strWhere + "");
                Lebi_Express_Log model = new Lebi_Express_Log();
                DataSet          ds    = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString());

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                    {
                        model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                    }
                    model.Number = ds.Tables[0].Rows[0]["Number"].ToString();
                    if (ds.Tables[0].Rows[0]["Time_Add"].ToString() != "")
                    {
                        model.Time_Add = DateTime.Parse(ds.Tables[0].Rows[0]["Time_Add"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(ds.Tables[0].Rows[0]["Status"].ToString());
                    }
                    model.IdList = ds.Tables[0].Rows[0]["IdList"].ToString();
                    if (ds.Tables[0].Rows[0]["Transport_id"].ToString() != "")
                    {
                        model.Transport_id = int.Parse(ds.Tables[0].Rows[0]["Transport_id"].ToString());
                    }
                    model.Transport_Name = ds.Tables[0].Rows[0]["Transport_Name"].ToString();
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
Beispiel #9
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_Express_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_Express_Log](");
                strSql.Append("[Number],[Time_Add],[Status],[IdList],[Transport_id],[Transport_Name],[Supplier_id])");
                strSql.Append(" values (");
                strSql.Append("@Number,@Time_Add,@Status,@IdList,@Transport_id,@Transport_Name,@Supplier_id)");
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Number",         model.Number),
                    new OleDbParameter("@Time_Add",       model.Time_Add.ToString("yyyy-MM-dd HH:mm:ss")),
                    new OleDbParameter("@Status",         model.Status),
                    new OleDbParameter("@IdList",         model.IdList),
                    new OleDbParameter("@Transport_id",   model.Transport_id),
                    new OleDbParameter("@Transport_Name", model.Transport_Name),
                    new OleDbParameter("@Supplier_id",    model.Supplier_id)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
                return(1);
            }
Beispiel #10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_Express_Log model)
 {
     D_Lebi_Express_Log.Instance.Update(model);
 }
Beispiel #11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_Express_Log model)
 {
     return(D_Lebi_Express_Log.Instance.Add(model));
 }
Beispiel #12
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_Express_Log SafeBindForm(Lebi_Express_Log model)
 {
     return(D_Lebi_Express_Log.Instance.SafeBindForm(model));
 }