Ejemplo n.º 1
0
            /// <summary>
            /// 对象实体绑定数据
            /// </summary>
            public Lebi_ServicePanel_Group ReaderBind(IDataReader dataReader)
            {
                Lebi_ServicePanel_Group model = new Lebi_ServicePanel_Group();
                object ojb;

                ojb = dataReader["id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.id = (int)ojb;
                }
                model.Name = dataReader["Name"].ToString();
                ojb        = dataReader["Sort"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Sort = (int)ojb;
                }
                model.Language = dataReader["Language"].ToString();
                ojb            = dataReader["Supplier_id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Supplier_id = (int)ojb;
                }
                model.Language_ids = dataReader["Language_ids"].ToString();
                return(model);
            }
Ejemplo n.º 2
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_ServicePanel_Group model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_ServicePanel_Group] set ");
                strSql.Append("Name= @Name,");
                strSql.Append("Sort= @Sort,");
                strSql.Append("Language= @Language,");
                strSql.Append("Supplier_id= @Supplier_id,");
                strSql.Append("Language_ids= @Language_ids");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id",           SqlDbType.Int,       4),
                    new SqlParameter("@Name",         SqlDbType.NVarChar, 20),
                    new SqlParameter("@Sort",         SqlDbType.Int,       4),
                    new SqlParameter("@Language",     SqlDbType.NVarChar, 50),
                    new SqlParameter("@Supplier_id",  SqlDbType.Int,       4),
                    new SqlParameter("@Language_ids", SqlDbType.NVarChar, 100)
                };
                parameters[0].Value = model.id;
                parameters[1].Value = model.Name;
                parameters[2].Value = model.Sort;
                parameters[3].Value = model.Language;
                parameters[4].Value = model.Supplier_id;
                parameters[5].Value = model.Language_ids;

                SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
Ejemplo n.º 3
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_ServicePanel_Group model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_ServicePanel_Group](");
                strSql.Append("Name,Sort,Language,Supplier_id,Language_ids)");
                strSql.Append(" values (");
                strSql.Append("@Name,@Sort,@Language,@Supplier_id,@Language_ids)");
                strSql.Append(";select @@IDENTITY");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@Name",         model.Name),
                    new SqlParameter("@Sort",         model.Sort),
                    new SqlParameter("@Language",     model.Language),
                    new SqlParameter("@Supplier_id",  model.Supplier_id),
                    new SqlParameter("@Language_ids", model.Language_ids)
                };

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

                if (obj == null)
                {
                    return(1);
                }
                else
                {
                    return(Convert.ToInt32(obj));
                }
            }
Ejemplo n.º 4
0
        public Lebi_ServicePanel_Group GetGroup(int group_id)
        {
            Lebi_ServicePanel_Group group = B_Lebi_ServicePanel_Group.GetModel(group_id);

            if (group == null)
            {
                group = new Lebi_ServicePanel_Group();
            }
            return(group);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                WindowNoPower();
            }
            model = B_Lebi_ServicePanel_Group.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (model == null)
            {
                model = new Lebi_ServicePanel_Group();
            }
        }
Ejemplo n.º 6
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_ServicePanel_Group model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_ServicePanel_Group](");
                strSql.Append("[Name],[Sort],[Language],[Supplier_id],[Language_ids])");
                strSql.Append(" values (");
                strSql.Append("@Name,@Sort,@Language,@Supplier_id,@Language_ids)");
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Name",         model.Name),
                    new OleDbParameter("@Sort",         model.Sort),
                    new OleDbParameter("@Language",     model.Language),
                    new OleDbParameter("@Supplier_id",  model.Supplier_id),
                    new OleDbParameter("@Language_ids", model.Language_ids)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
                return(1);
            }
Ejemplo n.º 7
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_ServicePanel_Group model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_ServicePanel_Group] set ");
                strSql.Append("[Name]=@Name,");
                strSql.Append("[Sort]=@Sort,");
                strSql.Append("[Language]=@Language,");
                strSql.Append("[Supplier_id]=@Supplier_id,");
                strSql.Append("[Language_ids]=@Language_ids");
                strSql.Append(" where id=" + model.id);
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@Name",         model.Name),
                    new OleDbParameter("@Sort",         model.Sort),
                    new OleDbParameter("@Language",     model.Language),
                    new OleDbParameter("@Supplier_id",  model.Supplier_id),
                    new OleDbParameter("@Language_ids", model.Language_ids)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
Ejemplo n.º 8
0
            /// <summary>
            /// 得到一个对象实体 by id
            /// </summary>
            public Lebi_ServicePanel_Group GetModel(int id)
            {
                StringBuilder strSql = new StringBuilder();

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

                Lebi_ServicePanel_Group model = new Lebi_ServicePanel_Group();
                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();
                    if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                    }
                    model.Language = ds.Tables[0].Rows[0]["Language"].ToString();
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    model.Language_ids = ds.Tables[0].Rows[0]["Language_ids"].ToString();
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
Ejemplo n.º 9
0
            /// <summary>
            /// 得到一个对象实体 by where条件
            /// </summary>
            public Lebi_ServicePanel_Group 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_Group] ");
                strSql.Append(" where " + strWhere + "");
                Lebi_ServicePanel_Group model = new Lebi_ServicePanel_Group();
                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();
                    if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                    }
                    model.Language = ds.Tables[0].Rows[0]["Language"].ToString();
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    model.Language_ids = ds.Tables[0].Rows[0]["Language_ids"].ToString();
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("servicepanel_group_add", "添加客服面板部门"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("servicepanel_group_edit", "编辑客服面板部门"))
                {
                    WindowNoPower();
                }
            }
            model = B_Lebi_ServicePanel_Group.GetModel(id);
            if (model == null)
            {
                model = new Lebi_ServicePanel_Group();
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 编辑客服面板部门信息
        /// </summary>
        public void ServicePanel_Group_Edit()
        {
            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                AjaxNoPower();
                return;
            }
            int  id      = RequestTool.RequestInt("id", 0);
            bool addflag = false;
            Lebi_ServicePanel_Group model = B_Lebi_ServicePanel_Group.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);

            if (model == null)
            {
                addflag = true;
                model   = new Lebi_ServicePanel_Group();
            }
            model              = B_Lebi_ServicePanel_Group.SafeBindForm(model);
            model.Name         = RequestTool.RequestSafeString("Name");
            model.Language_ids = RequestTool.RequestSafeString("Language_ids");
            model.Sort         = RequestTool.RequestInt("Sort", 0);
            if (addflag)
            {
                model.Supplier_id = CurrentSupplier.id;
                B_Lebi_ServicePanel_Group.Add(model);
                id = B_Lebi_ServicePanel_Group.GetMaxId();
                Log.Add("添加客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            else
            {
                B_Lebi_ServicePanel_Group.Update(model);
                Log.Add("编辑客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 安全方式绑定对象表单
 /// </summary>
 public Lebi_ServicePanel_Group SafeBindForm(Lebi_ServicePanel_Group model)
 {
     if (HttpContext.Current.Request["Name"] != null)
     {
         model.Name = Shop.Tools.RequestTool.RequestSafeString("Name");
     }
     if (HttpContext.Current.Request["Sort"] != null)
     {
         model.Sort = Shop.Tools.RequestTool.RequestInt("Sort", 0);
     }
     if (HttpContext.Current.Request["Language"] != null)
     {
         model.Language = Shop.Tools.RequestTool.RequestSafeString("Language");
     }
     if (HttpContext.Current.Request["Supplier_id"] != null)
     {
         model.Supplier_id = Shop.Tools.RequestTool.RequestInt("Supplier_id", 0);
     }
     if (HttpContext.Current.Request["Language_ids"] != null)
     {
         model.Language_ids = Shop.Tools.RequestTool.RequestSafeString("Language_ids");
     }
     return(model);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_ServicePanel_Group model)
 {
     D_Lebi_ServicePanel_Group.Instance.Update(model);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_ServicePanel_Group model)
 {
     return(D_Lebi_ServicePanel_Group.Instance.Add(model));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_ServicePanel_Group SafeBindForm(Lebi_ServicePanel_Group model)
 {
     return(D_Lebi_ServicePanel_Group.Instance.SafeBindForm(model));
 }