protected void UpPlat_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.SelReturnModel(UserID); M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Comp compMod = new M_Plat_Comp(); B_Plat_Comp compBll = new B_Plat_Comp(); if (upMod == null) { //------------------------------------ upMod = new M_User_Plat(); upMod.UserID = mu.UserID; upMod.TrueName = B_User.GetUserName(mu.HoneyName, mu.TrueName, mu.UserName); upMod.Post = ""; upMod.Status = 1; //---------------------------------------- compBll.CreateByUser(upMod); upBll.Insert(upMod); } else { if (upMod.CompID == 0)//兼容之前的逻辑 { compBll.CreateByUser(upMod); } upMod.Status = 1; upBll.UpdateByID(upMod); } ShowPlatInfo(upMod.UserID); function.WriteSuccessMsg("操作成功,你现在可以为该用户指定公司"); }
void ShowPlatInfo(int id) { M_User_Plat platModel = PlatBll.SelReturnModel(id); if (platModel != null) { platInfo_A.Visible = true; tbTrueName_T.Text = platModel.TrueName; DataTable dt = new B_Plat_Comp().Sel(); tbCompName_D.DataSource = dt; tbCompName_D.DataBind(); tbPost_T.Text = platModel.Post; tbPhone_T.Text = platModel.Mobile; } }
void ShowPlatInfo(int id) { M_User_Plat upMod = PlatBll.SelReturnModel(id); if (upMod != null) { DataTable compdt = new B_Plat_Comp().Sel(); platInfo_A.Visible = true; tbTrueName_T.Text = upMod.TrueName; tbCompName_D.DataSource = compdt; tbCompName_D.DataBind(); tbCompName_D.Items.Insert(0, new ListItem() { Text = "未指定公司", Value = "0" }); tbCompName_D.SelectedValue = upMod.CompID.ToString(); tbPost_T.Text = upMod.GroupName; //tbPhone_T.Text = platModel.Mobile; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { M_Plat_Comp compMod = new B_Plat_Comp().SelReturnModel(upMod.CompID); Main_UName_T.Text = upMod.TrueName.Length > 6 ? upMod.TrueName.Substring(0, 5) : upMod.TrueName; Main_UserFace_Img.Src = upMod.UserFace; M_CompName_L.Text = compMod.CompShort; logo_img.Src = compMod.CompLogo; GetNotify(upMod); //At_Lit.Text = upMod.AtCount > 0 ? "<span class='haveat'>" + upMod.AtCount + "</span>" : "<span class='noat'>0</span>"; //int emailCount= new B_Message().GetUnReadMail(upMod.UserID).Rows.Count; //Email_Lit.Text = emailCount > 0 ? "<span class='haveat'>" + emailCount + "</span>" : "<span class='noat'>0</span>";//后期也加入计数中 //Main_Skey_T.Text = Request.QueryString["Skey"]; //Comp_Img.Src = string.IsNullOrEmpty(compMod.CompLogo) ? "/Plat/images/vlogo.png" : compMod.CompLogo; //Comp_Href.HRef = UrlDeal(compMod.CompHref); //Comp_Href.InnerText = compMod.CompHref; //Main_UserFace_Img.Src =upMod.UserName; //Main_UserFace_Img.Attributes.Add("data-uid", upMod.UserID.ToString()); //Main_UserWord_Div.InnerText = upMod.UserName; } }