Exemple #1
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_ServicePanel_Type model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_ServicePanel_Type] set ");
                strSql.Append("[Name]=@Name,");
                strSql.Append("[Url]=@Url,");
                strSql.Append("[Code]=@Code,");
                strSql.Append("[Text]=@Text,");
                strSql.Append("[Face]=@Face,");
                strSql.Append("[IsOnline]=@IsOnline,");
                strSql.Append("[Sort]=@Sort");
                strSql.Append(" where id=" + model.id);
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Name",     model.Name),
                    new OleDbParameter("@Url",      model.Url),
                    new OleDbParameter("@Code",     model.Code),
                    new OleDbParameter("@Text",     model.Text),
                    new OleDbParameter("@Face",     model.Face),
                    new OleDbParameter("@IsOnline", model.IsOnline),
                    new OleDbParameter("@Sort",     model.Sort)
                };

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

                ojb = dataReader["id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.id = (int)ojb;
                }
                model.Name = dataReader["Name"].ToString();
                model.Url  = dataReader["Url"].ToString();
                model.Code = dataReader["Code"].ToString();
                model.Text = dataReader["Text"].ToString();
                model.Face = dataReader["Face"].ToString();
                ojb        = dataReader["IsOnline"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.IsOnline = (int)ojb;
                }
                ojb = dataReader["Sort"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Sort = (int)ojb;
                }
                return(model);
            }
Exemple #3
0
 /// <summary>
 /// 安全方式绑定对象表单
 /// </summary>
 public Lebi_ServicePanel_Type SafeBindForm(Lebi_ServicePanel_Type model)
 {
     if (HttpContext.Current.Request["Name"] != null)
     {
         model.Name = Shop.Tools.RequestTool.RequestSafeString("Name");
     }
     if (HttpContext.Current.Request["Url"] != null)
     {
         model.Url = Shop.Tools.RequestTool.RequestSafeString("Url");
     }
     if (HttpContext.Current.Request["Code"] != null)
     {
         model.Code = Shop.Tools.RequestTool.RequestSafeString("Code");
     }
     if (HttpContext.Current.Request["Text"] != null)
     {
         model.Text = Shop.Tools.RequestTool.RequestSafeString("Text");
     }
     if (HttpContext.Current.Request["Face"] != null)
     {
         model.Face = Shop.Tools.RequestTool.RequestSafeString("Face");
     }
     if (HttpContext.Current.Request["IsOnline"] != null)
     {
         model.IsOnline = Shop.Tools.RequestTool.RequestInt("IsOnline", 0);
     }
     if (HttpContext.Current.Request["Sort"] != null)
     {
         model.Sort = Shop.Tools.RequestTool.RequestInt("Sort", 0);
     }
     return(model);
 }
Exemple #4
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_ServicePanel_Type model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_ServicePanel_Type] set ");
                strSql.Append("Name= @Name,");
                strSql.Append("Url= @Url,");
                strSql.Append("Code= @Code,");
                strSql.Append("Text= @Text,");
                strSql.Append("Face= @Face,");
                strSql.Append("IsOnline= @IsOnline,");
                strSql.Append("Sort= @Sort");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id",       SqlDbType.Int,        4),
                    new SqlParameter("@Name",     SqlDbType.NVarChar,  30),
                    new SqlParameter("@Url",      SqlDbType.NVarChar, 200),
                    new SqlParameter("@Code",     SqlDbType.NVarChar, 200),
                    new SqlParameter("@Text",     SqlDbType.NVarChar,  50),
                    new SqlParameter("@Face",     SqlDbType.NVarChar,  50),
                    new SqlParameter("@IsOnline", SqlDbType.Int,        4),
                    new SqlParameter("@Sort",     SqlDbType.Int, 4)
                };
                parameters[0].Value = model.id;
                parameters[1].Value = model.Name;
                parameters[2].Value = model.Url;
                parameters[3].Value = model.Code;
                parameters[4].Value = model.Text;
                parameters[5].Value = model.Face;
                parameters[6].Value = model.IsOnline;
                parameters[7].Value = model.Sort;

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

                strSql.Append("insert into [Lebi_ServicePanel_Type](");
                strSql.Append("Name,Url,Code,Text,Face,IsOnline,Sort)");
                strSql.Append(" values (");
                strSql.Append("@Name,@Url,@Code,@Text,@Face,@IsOnline,@Sort)");
                strSql.Append(";select @@IDENTITY");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@Name",     model.Name),
                    new SqlParameter("@Url",      model.Url),
                    new SqlParameter("@Code",     model.Code),
                    new SqlParameter("@Text",     model.Text),
                    new SqlParameter("@Face",     model.Face),
                    new SqlParameter("@IsOnline", model.IsOnline),
                    new SqlParameter("@Sort",     model.Sort)
                };

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

                if (obj == null)
                {
                    return(1);
                }
                else
                {
                    return(Convert.ToInt32(obj));
                }
            }
        public Lebi_ServicePanel_Type GetType(int type_id)
        {
            Lebi_ServicePanel_Type type = B_Lebi_ServicePanel_Type.GetModel(type_id);

            if (type == null)
            {
                type = new Lebi_ServicePanel_Type();
            }
            return(type);
        }
Exemple #7
0
            /// <summary>
            /// 得到一个对象实体 by id
            /// </summary>
            public Lebi_ServicePanel_Type GetModel(int id)
            {
                StringBuilder strSql = new StringBuilder();

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

                Lebi_ServicePanel_Type model = new Lebi_ServicePanel_Type();
                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.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                    model.Url  = ds.Tables[0].Rows[0]["Url"].ToString();
                    model.Code = ds.Tables[0].Rows[0]["Code"].ToString();
                    model.Text = ds.Tables[0].Rows[0]["Text"].ToString();
                    model.Face = ds.Tables[0].Rows[0]["Face"].ToString();
                    if (ds.Tables[0].Rows[0]["IsOnline"].ToString() != "")
                    {
                        model.IsOnline = int.Parse(ds.Tables[0].Rows[0]["IsOnline"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
Exemple #8
0
            /// <summary>
            /// 得到一个对象实体 by where条件
            /// </summary>
            public Lebi_ServicePanel_Type 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_ServicePanel_Type] ");
                strSql.Append(" where " + strWhere + "");
                Lebi_ServicePanel_Type model = new Lebi_ServicePanel_Type();
                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.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                    model.Url  = ds.Tables[0].Rows[0]["Url"].ToString();
                    model.Code = ds.Tables[0].Rows[0]["Code"].ToString();
                    model.Text = ds.Tables[0].Rows[0]["Text"].ToString();
                    model.Face = ds.Tables[0].Rows[0]["Face"].ToString();
                    if (ds.Tables[0].Rows[0]["IsOnline"].ToString() != "")
                    {
                        model.IsOnline = int.Parse(ds.Tables[0].Rows[0]["IsOnline"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
Exemple #9
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_ServicePanel_Type model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_ServicePanel_Type](");
                strSql.Append("[Name],[Url],[Code],[Text],[Face],[IsOnline],[Sort])");
                strSql.Append(" values (");
                strSql.Append("@Name,@Url,@Code,@Text,@Face,@IsOnline,@Sort)");
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Name",     model.Name),
                    new OleDbParameter("@Url",      model.Url),
                    new OleDbParameter("@Code",     model.Code),
                    new OleDbParameter("@Text",     model.Text),
                    new OleDbParameter("@Face",     model.Face),
                    new OleDbParameter("@IsOnline", model.IsOnline),
                    new OleDbParameter("@Sort",     model.Sort)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
                return(1);
            }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("servicepanel_type_add", "添加客服面板软件"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("servicepanel_type_edit", "编辑客服面板软件"))
                {
                    WindowNoPower();
                }
            }
            model = B_Lebi_ServicePanel_Type.GetModel(id);
            if (model == null)
            {
                model = new Lebi_ServicePanel_Type();
            }
        }
Exemple #11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_ServicePanel_Type model)
 {
     D_Lebi_ServicePanel_Type.Instance.Update(model);
 }
Exemple #12
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_ServicePanel_Type model)
 {
     return(D_Lebi_ServicePanel_Type.Instance.Add(model));
 }
Exemple #13
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_ServicePanel_Type SafeBindForm(Lebi_ServicePanel_Type model)
 {
     return(D_Lebi_ServicePanel_Type.Instance.SafeBindForm(model));
 }