/// <summary>
 /// 数据绑定
 /// </summary>
 public override void DataBind()
 {
     using (PhysicalDepartmentBusiness Business = new PhysicalDepartmentBusiness()) {
         int    RecordCount = 0;
         String DeptName    = txtSearch.Text.Trim();
         DepartmentRepeater.DataSource = Business.GetPhysicalDepartments(Pager.CurrentPageIndex,
                                                                         Pager.PageSize, DeptName, out RecordCount);
         Pager.RecordCount = RecordCount;
     }
     base.DataBind();
 }
Beispiel #2
0
    private int GetDeptID(String DeptName)
    {
        int DeptID = int.MinValue;

        if (String.IsNullOrWhiteSpace(DeptName))
        {
            return(DeptID);
        }
        using (PhysicalDepartmentBusiness Business = new PhysicalDepartmentBusiness()){
            DeptID = Business.GetPhysicalDepartmentID(DeptName);
        }
        return(DeptID);
    }
 /// <summary>
 /// 数据绑定
 /// </summary>
 public override void DataBind()
 {
     using (PhysicalDepartmentBusiness Department = new PhysicalDepartmentBusiness()) {
         int    RecordCount = 0;
         String DeptName    = txtSearch.Text.Trim();
         IList <PhysicalDepartmentEntity> DataSource = Department.GetPhysicalDepartments(Pager.CurrentPageIndex,
                                                                                         Pager.PageSize, DeptName, out RecordCount);
         DepartmentRepeater.DataSource = DataSource;
         Pager.RecordCount             = RecordCount;
         if (DataSource.Count > 0)
         {
             BindDepartmentGroup(DataSource[0].DeptID);
         }
         if (DataSource.Count <= 0)
         {
             BindDepartmentGroup(DeptID);
         }
     }
     base.DataBind();
 }
Beispiel #4
0
    protected void btnMessages_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < this.CompanyRepeater.Items.Count; i++)
        {
            CheckBox cb   = (CheckBox)CompanyRepeater.Items[i].FindControl("checkbox1");
            Literal  ltid = (Literal)CompanyRepeater.Items[i].FindControl("lblCompanyID");
            if (cb.Checked)
            {
                //Maticsoft.Model.messages.messagesjoin  en = new  Maticsoft.Model.messages.messagesjoin();

                //en = m_Company.GetCompany(Convert.ToInt32(ltid.Text));

                PhysicalDepartmentEntity en = new PhysicalDepartmentEntity();

                en = new PhysicalDepartmentBusiness().GetPhysicalDepartment(Convert.ToInt32(ltid.Text));

                if (en != null)
                {
                    //string smsResult = SMS.Send("",en.telephone);

                    Maticsoft.BLL.messages.messages_type   bllType = new Maticsoft.BLL.messages.messages_type();
                    Maticsoft.Model.messages.messages_type msgType = new Maticsoft.Model.messages.messages_type();

                    Maticsoft.Model.messages.messages model = new Maticsoft.Model.messages.messages();

                    model.type     = messagesType.单位体检通知.ToString();
                    model.rcvMan   = en.Leader;
                    model.rcvTel   = en.LinkTel;
                    model.unit     = en.DeptName;
                    model.sendTime = DateTime.Now;
                    msgType        = bllType.GetModelbyCode(messagesType.单位体检通知.GetHashCode().ToString());
                    if (msgType != null)
                    {
                        model.content = msgType.templet;
                    }

                    model.status = "成功";

                    Maticsoft.BLL.messages.messages bll = new Maticsoft.BLL.messages.messages();
                    if (bll.Add(model))
                    {
                        Maticsoft.Model.messages.messagesjoin modeljoin = new Maticsoft.Model.messages.messagesjoin();

                        Maticsoft.BLL.messages.messagesjoin blljoin = new Maticsoft.BLL.messages.messagesjoin();

                        if (blljoin.Exists("PhysicalDepartment", en.DeptID.ToString()))
                        {
                            string sqlW = string.Format(" jointable='PhysicalDepartment' And tableCode='{0}'", en.DeptID.ToString());
                            modeljoin = blljoin.GetModelList(sqlW)[0];

                            modeljoin.messagesid = bll.GetMaxId() - 1;


                            blljoin.Update(modeljoin);
                        }
                        else
                        {
                            modeljoin.jointable  = "PhysicalDepartment";
                            modeljoin.tableCode  = en.DeptID.ToString();
                            modeljoin.messagesid = bll.GetMaxId() - 1;

                            blljoin.Add(modeljoin);
                        }
                    }
                }
            }
        }
        DataBind();
    }
 protected override void OnUnload(EventArgs e)
 {
     m_PhysicalDepartment.Dispose();
     m_PhysicalDepartment = null;
     base.OnUnload(e);
 }
 protected override void OnInit(EventArgs e)
 {
     m_PhysicalDepartment = new PhysicalDepartmentBusiness();
     base.OnInit(e);
 }