예제 #1
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();
            M_MailTemp  tlpMod   = new M_MailTemp();

            if (Mid > 0)
            {
                tlpMod = bll.SelReturnModel(Mid);
            }
            tlpMod.TempName = TxtTempName.Text;
            tlpMod.Type     = Convert.ToInt32(drType.SelectedValue);
            tlpMod.Content  = TxtContent.Value;
            tlpMod.AddUser  = adminMod.AdminName;
            if (string.IsNullOrEmpty(tlpMod.Pic))
            {
                tlpMod.Pic = "";
            }
            if (!tlpMod.Pic.Equals(SFileUp.FVPath))
            {
                tlpMod.Pic = SFileUp.SaveFile();
            }
            if (Mid > 0)
            {
                bll.UpdateByID(tlpMod);
            }
            else
            {
                bll.insert(tlpMod);
            }
            function.WriteSuccessMsg("操作成功", "MailTemplist.aspx");
        }
예제 #2
0
    protected void Save_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo   loginUser = buser.GetLogin();
        M_Store_Info storeMod  = storeBll.SelModelByUser(loginUser.UserID);
        M_UserInfo   mu        = null;
        string       uname     = UserName_T.Text.Trim();
        string       upwd      = UserPwd_T.Text.Trim();
        string       upwd2     = UserPwd2_T.Text.Trim();

        if (Mid > 0)
        {
            mu = buser.SelReturnModel(Mid);
            //修改密码
            if (!string.IsNullOrEmpty(upwd))
            {
                if (!upwd.Equals(upwd2))
                {
                    function.WriteErrMsg("密码与确认密码不匹配");
                }
                mu.UserPwd = StringHelper.MD5(upwd);
            }
        }
        else
        {
            if (StrHelper.StrNullCheck(uname, upwd, upwd2))
            {
                function.WriteErrMsg("用户名或密码不能为空");
            }
            if (!upwd.Equals(upwd2))
            {
                function.WriteErrMsg("密码与确认密码不匹配");
            }
            if (buser.IsExistUName(uname))
            {
                function.WriteErrMsg("用户名[" + uname + "]已存在");
            }
            mu         = buser.NewUser(uname, upwd);
            mu.SiteID  = storeMod.ID;
            mu.GroupID = ExConast.EmployGroup;
        }
        mu.SiteRebateBalance = DataConvert.CDouble(SiteRebateBalance_T.Text);
        mu.ZnPassword        = Mobile_T.Text;
        mu.VIP    = DataConvert.CLng(Request.Form["bonus_rad"]);
        mu.PageID = DataConvert.CLng(Request.Form["role_rad"]);
        if (SFileUp.HasFile)
        {
            SFileUp.SaveUrl = ZLHelper.GetUploadDir_System("shop", "user");
            mu.UserFace     = SFileUp.SaveFile();
        }
        if (mu.UserID > 0)
        {
            buser.UpdateByID(mu);
        }
        else
        {
            buser.AddModel(mu);
        }
        function.WriteSuccessMsg("操作成功", "Employee.aspx");
    }
예제 #3
0
        //添加或修改客服
        protected void Button1_Click(object sender, EventArgs e)
        {
            SFileUp.SaveFile();
            M_UserInfo mu = buser.GetUserByName(User_T.Text);

            if (mu == null)
            {
                mu           = new M_UserInfo();
                mu.UserName  = User_T.Text;
                mu.UserPwd   = StringHelper.MD5("123456");
                mu.Status    = 0;
                mu.Email     = function.GetRandomString(8) + "@ss.com";
                mu.HoneyName = SeatName_T.Text;
                mu.UserFace  = SFileUp.FileUrl;
                mu.UserID    = buser.AddModel(mu);
            }
            if (Mid > 0)
            {
                seatMod = seatBll.GetSelect(Mid);
            }
            seatMod.S_Index   = DataConverter.CLng(ddlIndex.SelectedValue);
            seatMod.S_Name    = SeatName_T.Text;
            seatMod.S_AdminID = mu.UserID;
            seatMod.S_Default = RadioButtonList1.Checked ? 1 : 0;
            seatMod.S_Remrk   = mu.UserName;
            seatMod.S_FaceImg = SFileUp.FileUrl;
            if (RadioButtonList1.Checked)
            {
                seatBll.UpdateDefault(0);
            }
            if (Mid > 0)
            {
                mu.HoneyName = SeatName_T.Text;
                mu.UserFace  = SFileUp.FileUrl;
                buser.UpDateUser(mu);
                seatBll.InsertUpdateByAdminid(seatMod);
                function.WriteSuccessMsg("席位修改成功", "ServiceSeat.aspx");
            }
            else
            {
                seatBll.Insert(seatMod);
                function.WriteSuccessMsg("席位添加成功", "ServiceSeat.aspx");
            }
        }
예제 #4
0
    protected void Save_B_Click(object sender, EventArgs e)
    {
        //存商品表中,这样只有显示的逻辑需要扩展,其他逻辑可不变
        //商品增加筛选模型,便于扩展
        M_UserInfo mu     = buser.GetLogin();
        M_Product  proMod = proBll.GetproductByid(Mid);

        if (proMod == null)
        {
            proMod = new M_Product();
        }
        proMod.Proname = Name_T.Text.Trim();
        //proMod.BindIDS = UProIDS_Hid.Value;
        proMod.Procontent = UProIDS_Hid.Value;
        if (SFileUp.HasFile)
        {
            SFileUp.SaveUrl   = ZLHelper.GetUploadDir_System("shop", "product", "yyyyMMdd");
            proMod.Thumbnails = SFileUp.SaveFile();
        }
        proMod.LinPrice = DataConverter.CDouble(Price_T.Text);
        //proMod.BookPrice = DataConverter.CDouble(BookPrice_T.Text);
        proMod.ShiPrice = proMod.LinPrice;
        //proMod.Istrue = ZStatus_Chk.Checked ? 1 : 0;
        proMod.Proinfo    = Remind_T.Text;
        proMod.Nodeid     = 16;
        proMod.ModelID    = 20;
        proMod.GuessXML   = Request.Form["GuessXML"];
        proMod.UserShopID = mu.SiteID;
        if (proMod.ID > 0)
        {
            proBll.UpdateByID(proMod);
        }
        else
        {
            proMod.FirstNodeID = nodeBll.SelFirstNodeID(proMod.Nodeid);
            proMod.Class       = 2;
            proMod.ProClass    = 1;
            proMod.UserID      = mu.UserID;
            proMod.AddUser     = mu.UserName;
            proBll.Insert(proMod);
        }
        function.WriteSuccessMsg("操作成功", "SuitPro.aspx");
    }
        //选择好用户后,为其创建相关信息
        protected void Submit_Btn_Click(object sender, EventArgs e)
        {
            int        uid = Convert.ToInt32(User_Hid.Value.Split(',')[0]);
            M_UserInfo mu  = buser.SelReturnModel(uid);

            if (mu.IsNull)
            {
                function.WriteErrMsg("用户[" + User_T.Text + "]不存在");
            }
            if (upBll.SelReturnModel(uid) != null)
            {
                function.WriteErrMsg("创建失败:用户" + User_T.Text + "已经有了企业,不能重复创建");
            }
            M_Plat_Comp     compMod = new M_Plat_Comp();
            M_Plat_UserRole urMod   = new M_Plat_UserRole();
            DataTable       userDT  = JsonConvert.DeserializeObject <DataTable>(UserInfo_Hid.Value);//为空下是否会报错

            if (SFileUp.HasFile)
            {
                SFileUp.SaveFile();
            }
            //------------------公司
            compMod.CompName   = CompName_T.Text;
            compMod.Status     = 1;
            compMod.CreateUser = mu.UserID;
            compMod.CompLogo   = SFileUp.FileUrl;
            compMod.UPPath     = compBll.CreateUPPath(compMod);
            compMod.ID         = compBll.Insert(compMod);
            //------------------角色
            urMod.IsSuper  = 1;
            urMod.RoleAuth = "";
            urMod.CompID   = compMod.ID;
            urMod.RoleName = "网络管理员";
            urMod.RoleDesc = "公司网络管理员,拥有全部权限,该角色只允许存在一个";
            urMod.UserID   = mu.UserID;
            urMod.ID       = urBll.Insert(urMod);
            //------------------网络管理员
            {
                M_User_Plat upMod = upBll.NewUser(mu, compMod);
                upMod.Plat_Role = "," + urMod.ID + ",";
                upBll.Insert(upMod);
                M_Plat_Group gpMod = NewGroup(upMod.CompID, "办公部门", upMod.UserID);
                gpBll.Insert(gpMod);
            }
            //------------------其他权限管理员
            {
                for (int i = 0; i < userDT.Rows.Count; i++)
                {
                    string gname = userDT.Rows[i]["gname"].ToString();
                    string uname = userDT.Rows[i]["uname"].ToString();
                    string honey = userDT.Rows[i]["honey"].ToString();
                    if (string.IsNullOrEmpty(uname))
                    {
                        continue;
                    }
                    M_UserInfo newmu = buser.NewUser(uname, "111111");
                    newmu.HoneyName = honey;
                    newmu.UserID    = buser.Add(newmu);
                    M_Uinfo basemu = buser.NewBase(newmu);
                    buser.AddBase(basemu);
                    //----能力相关信息
                    M_Plat_Group gpMod = NewGroup(compMod.ID, gname, newmu.UserID);
                    M_User_Plat  upMod = upBll.NewUser(newmu, compMod);
                    gpMod.ID  = gpBll.Insert(gpMod);
                    upMod.Gid = gpMod.ID.ToString();
                    upBll.Insert(upMod);
                }
            }
            function.WriteSuccessMsg(mu.UserName + "的企业[" + compMod.CompName + "]创建成功", "CompList.aspx");
        }