Exemplo n.º 1
0
        public void BinInfo(int id)
        {
            Cultural.Model.Member     member = new Cultural.Model.Member();
            Cultural.BLL.Member       bll    = new Cultural.BLL.Member();
            Cultural.BLL.Department   dbll   = new Cultural.BLL.Department();
            Cultural.Model.Department dmodel = new Cultural.Model.Department();
            member = bll.GetModel(id);

            if (member != null)
            {
                if (member.DepartID != 0 && member.DepartID != null)
                {
                    dmodel = dbll.GetModel(int.Parse(member.DepartID.ToString()));
                }
                txtLoginID.Text         = member.LoginID;
                txtPassword.Text        = member.Password;
                txtStaffName.Text       = member.MembName;
                ddlGender.SelectedIndex = ddlGender.Items.IndexOf(ddlGender.Items.FindByText(member.Gender));
                txtPhone.Text           = member.Phone;
                txtEmail.Text           = member.Email;
                txtAddress.Text         = member.Address;
                txtJob.Text             = member.JobName;
                txtDepartID.Text        = dmodel == null ? "" : dmodel.DepartName;
                txtResume.Text          = member.Resume;
                ddlType.SelectedIndex   = int.Parse(member.Status == "" ? "0" : member.Status == null ? "0" : member.Status);
                lblRegtime.Text         = member.RegTime.ToString();
                Photo.ImageUrl          = CommonFun.URLConverToServer("../../Image/Photo/" + member.PhotoURL);
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "出错!请重试!", "../Main.aspx");
            }
        }
Exemplo n.º 2
0
 public void TextBoxBind(int id)
 {
     Cultural.Model.Department depart = new Cultural.Model.Department();
     depart = departBll.GetModel(id);
     if (depart != null)
     {
         txtDepartName.Text          = depart.DepartName;
         txtChargeName.Text          = depart.MainCharge;
         txtAddress.Text             = depart.Address;
         txtConnect.Text             = depart.Phone;
         ddlDepartType.SelectedIndex = ddlDepartType.Items.IndexOf(ddlDepartType.Items.FindByValue(depart.BoardID.ToString()));
         ddlShow.SelectedIndex       = depart.Weight == 0 ? 0 : 1;
         MemPhoto.ImageUrl           = @"../../Image/DepartPhoto/" + depart.PicURL;
         txtResume.Text    = depart.Describ;
         hidFilePath.Value = depart.PicURL;
     }
 }
Exemplo n.º 3
0
 protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "MemDelete")
     {
         Cultural.Model.Department depart = new Cultural.Model.Department();
         depart        = bll.GetModel(int.Parse(e.CommandArgument.ToString()));
         depart.Status = "0";
         bll.Update(depart);
         BindData();
     }
     if (e.CommandName == "DepartTop")
     {
         Cultural.Model.Department depart = new Cultural.Model.Department();
         depart        = bll.GetModel(int.Parse(e.CommandArgument.ToString()));
         depart.Weight = depart.Weight == 9?8:9;
         bll.Update(depart);
         BindData();
     }
 }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            if (id != null & id != "")
            {
                Cultural.Model.Member     member = new Cultural.Model.Member();
                Cultural.BLL.Member       bll    = new Cultural.BLL.Member();
                Cultural.BLL.Department   dbll   = new Cultural.BLL.Department();
                Cultural.Model.Department dmodel = new Cultural.Model.Department();
                if (member.DepartID != 0 && member.DepartID != null)
                {
                    dmodel = dbll.GetModel(int.Parse(member.DepartID.ToString()));
                }
                member = bll.GetModel(int.Parse(id.Trim()));
                if (member != null)
                {
                    txtLoginID.Text       = member.LoginID;
                    txtPassword.Text      = member.Password;
                    txtStaffName.Text     = member.MembName;
                    lblGender.Text        = member.Gender;
                    txtPhone.Text         = member.Phone;
                    txtEmail.Text         = member.Email;
                    txtAddress.Text       = member.Address;
                    txtJob.Text           = member.JobName;
                    txtDepartID.Text      = dmodel == null ? "" : dmodel.DepartName;
                    txtResume.Text        = member.Resume;
                    ddlType.SelectedIndex = int.Parse(member.Status == "" ? "0" : member.Status == null ? "0" : member.Status);
                    lblRegtime.Text       = member.RegTime.ToString();
                    Photo.ImageUrl        = "../../Image/Photo/" + member.PhotoURL;
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "出错!请重试!", "../Main.aspx");
                }
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "出错!请重试!", "../Main.aspx");
            }
        }
Exemplo n.º 5
0
        /*
         * public string GetBIDByQueryStr(object queryStr)
         * {
         *  string tempid = "0";
         *  ResetHashTable();
         *  if (queryStr != null && queryStr.ToString().Trim() != "")
         *  {
         *      foreach (DictionaryEntry h in ht)
         *      {
         *          if (queryStr.ToString().Trim() == h.Value.ToString())
         *          {
         *              tempid = h.Key.ToString();
         *              break;
         *          }
         *          else
         *          {
         *              continue;
         *          }
         *      }
         *      return tempid;
         *  }
         *  else
         *  {
         *      return "0";
         *  }
         * }
         *
         * public void ResetHashTable()
         * {
         *  List<Cultural.Model.Board> bList = boardBll.GetModelList(" Status!='0' ");
         *  ht.Clear();
         *  for (int i = 0; i < bList.Count; i++)
         *  {
         *      ht.Add(bList[i].BoardID, bList[i].BoardName);
         *  }
         * }
         */

        public string GetDepartNameByID(object ID)
        {
            if (ID != null && ID.ToString().Trim() != "")
            {
                Cultural.BLL.Department   departBll = new Cultural.BLL.Department();
                Cultural.Model.Department depart    = new Cultural.Model.Department();
                depart = departBll.GetModel(int.Parse(ID.ToString()));
                if (depart != null)
                {
                    return(depart.DepartName);
                }
                else
                {
                    return("");
                }
            }
            else
            {
                return("");
            }
        }