Пример #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            E_Property data = new E_Property();

            data.PersonalID = PersonalID;
            data.TradeFlag  = cbTrade.Checked ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            data.AreaFlag   = cbArea.Checked ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            data.SourceFlag = cbSource.Checked ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            bool b = new T_Property().Set(data);

            MLMGC.COMP.Jscript.ShowMsg("保存" + (b ? "成功" : "失败"), this);
            databind();
        }
Пример #2
0
        //#region 角色
        ///// <summary>
        ///// 设置用户角色信息
        ///// </summary>
        //void SetUserRole()
        //{
        //    MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
        //    int uid = int.Parse(nv["uid"]);
        //    string v = nv["v"];
        //    int i = new T_User().SetTeamUserRole(new E_User() { EnterpriseID = ep.EnterpriceID, UserID = uid, RoleSetting = v });
        //    HttpContext.Current.Response.Write(i);
        //}
        //#endregion

        #region 属性
        /// <summary>
        /// 设置属性
        /// </summary>
        void SetProperty()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            string     trade  = nv["trade"];
            string     area   = nv["area"];
            string     source = nv["source"];
            E_Property data   = new E_Property();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeFlag    = trade == "true" ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            data.AreaFlag     = area == "true" ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            data.SourceFlag   = source == "true" ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            bool b = new T_Property().Set(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Пример #3
0
        /// <summary>
        /// 设置名录属性配置
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool Set(E_Property data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@SourceFlag",   SqlDbType.TinyInt),
                new SqlParameter("@TradeFlag",    SqlDbType.TinyInt),
                new SqlParameter("@AreaFlag",     SqlDbType.TinyInt)
            };
            parms[0].Value = data.EnterpriseID;
            parms[1].Value = (int)data.SourceFlag;
            parms[2].Value = (int)data.TradeFlag;
            parms[3].Value = (int)data.AreaFlag;
            int ReturnValue = 0;

            DbHelperSQL.RunProcedures("ProcEP_B_PropertyConfig_Update", parms, out ReturnValue);
            return(ReturnValue > 0);
        }
Пример #4
0
        /// <summary>
        /// 获取名录属性配置
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public E_Property Get(E_Property data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int)
            };
            parms[0].Value = data.EnterpriseID;
            DataTable dt = DbHelperSQL.RunProcedureTable("ProcEP_B_PropertyConfig_Select", parms);

            if (dt != null && dt.Rows.Count == 1)
            {
                data.PropertyConfigID = Convert.ToInt32(dt.Rows[0]["PropertyConfigID"].ToString());
                data.SourceFlag       = dt.Rows[0]["SourceFlag"].ToString().Equals("1") ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
                data.TradeFlag        = dt.Rows[0]["TradeFlag"].ToString().Equals("1") ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
                data.AreaFlag         = dt.Rows[0]["AreaFlag"].ToString().Equals("1") ? EnumPropertyEnabled.启用 : EnumPropertyEnabled.禁用;
            }
            else
            {
                data = new E_Property();
            }
            return(data);
        }
Пример #5
0
 /// <summary>
 /// 设置名录属性配置
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public bool Set(E_Property data)
 {
     return(dal.Set(data));
 }
Пример #6
0
 /// <summary>
 /// 获取名录属性配置
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public E_Property Get(E_Property data)
 {
     return(dal.Get(data));
 }
Пример #7
0
        protected void databind(MLMGC.Security.PersonalPage p)
        {
            //MLMGC.Security.EnterprisePage eppage = (MLMGC.Security.EnterprisePage)this.Page;
            MLMGC.Security.PersonalPage pp = (MLMGC.Security.PersonalPage) this.Page;
            int personalID = pp.PersonalID;

            if (data == null)//判断是否传递过来参数
            {
                data = new T_Property().Get(new E_Property()
                {
                    PersonalID = personalID
                });
            }
            TradeFlag  = Convert.ToBoolean((int)data.TradeFlag);
            AreaFlag   = Convert.ToBoolean((int)data.AreaFlag);
            SourceFlag = Convert.ToBoolean((int)data.SourceFlag);
            if (data.SourceFlag == EnumPropertyEnabled.启用)//判断来源
            {
                DataDictionaries.BindProperty(ddlSource, new T_Source().GetShowList(new E_Source()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlSource.Enabled = false;
            }
            if (data.TradeFlag == EnumPropertyEnabled.启用)//判断行业
            {
                DataDictionaries.BindProperty(ddlTrade, new T_Trade().GetShowList(new E_Trade()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlTrade.Enabled = false;
            }
            if (data.AreaFlag == EnumPropertyEnabled.启用)//判断地区
            {
                DataDictionaries.BindProperty(ddlArea, new T_Area().GetShowList(new E_Area()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlArea.Enabled = false;
            }
            //增加默认值
            ddlSource.Items.Insert(0, new ListItem("  ", "-1"));
            ddlTrade.Items.Insert(0, new ListItem("  ", "-1"));
            ddlArea.Items.Insert(0, new ListItem("  ", "-1"));
            //设置默认选项
            if (_sourceid != null)
            {
                ddlSource.SelectedValue = _sourceid.ToString(); lblSource.Text = ddlSource.SelectedItem.Text;
            }
            if (_tradeid != null)
            {
                ddlTrade.SelectedValue = _tradeid.ToString(); lblTrade.Text = ddlTrade.SelectedItem.Text;
            }
            if (_areaid != null)
            {
                ddlArea.SelectedValue = _areaid.ToString(); lblArea.Text = ddlArea.SelectedItem.Text;
            }
        }