protected void btnSavePhysicalDepartment_Click(object sender, EventArgs e) { PhysicalDepartmentEntity Result = GetPhysicalDepartmentUI(); m_PhysicalDepartment.SavePhysicalDepartment(Result); DeptID = Result.DeptID; ShowMessage("体检单位数据保存成功!"); DataBind(); SetUIState("Default"); }
protected void btnDeletePhysicalDepartment_Click(object sender, EventArgs e) { PhysicalDepartmentEntity PhysicalDepartment = GetPhysicalDepartmentUI(); if (PhysicalDepartment.DeptID == 1) { ShowMessage("该体检单位为系统保留项不能删除!"); return; } m_PhysicalDepartment.DeletePhysicalDepartment(PhysicalDepartment); ShowMessage("体检单位数据删除成功!"); DataBind(); SetUIState("Default"); }
/// <summary> /// 从界面获取对象 /// </summary> /// <returns></returns> private PhysicalDepartmentEntity GetPhysicalDepartmentUI() { PhysicalDepartmentEntity Result = new PhysicalDepartmentEntity(); Result.DeptID = DeptID; Result.DeptName = txtDeptName.Text; Result.Leader = txtLeader.Text; Result.LinkTel = txtLinkTel.Text; Result.Fax = txtFax.Text; Result.PostCode = txtPostCode.Text; Result.Address = txtAddress.Text; Result.Bank = txtBank.Text; Result.BankAccount = txtBankAccount.Text; Result.Nature = drpNature.SelectedValue; Result.Comment = txtComment.Text; return(Result); }
/// <summary> /// 填充界面 /// </summary> private void SetPhysicalDepartmentUI() { PhysicalDepartmentEntity Result = m_PhysicalDepartment.GetPhysicalDepartment(DeptID); if (Result == null) { return; } txtDeptName.Text = Result.DeptName; txtLeader.Text = Result.Leader; txtLinkTel.Text = Result.LinkTel; txtFax.Text = Result.Fax; txtPostCode.Text = Result.PostCode; txtAddress.Text = Result.Address; txtBank.Text = Result.Bank; txtBankAccount.Text = Result.BankAccount; drpNature.SelectedValue = Result.Nature; txtComment.Text = Result.Comment; }
public void DeletePhysicalDepartment(PhysicalDepartmentEntity PhysicalDepartment) { DataAccess.DeletePhysicalDepartment(PhysicalDepartment); }
public void SavePhysicalDepartment(PhysicalDepartmentEntity PhysicalDepartment) { DataAccess.SavePhysicalDepartment(PhysicalDepartment); }
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(); }