/// <summary> /// 获取一条AddNumber类信息 /// </summary> /// <param name="AddNumberID">登录编号</param> /// <returns>一条AddNumber类记录</returns> public AddNumber GetAddNumber(string AddNumberID) { AddNumber addNumber = new AddNumber(); Guide2Mgr g2Mgr = new Guide2Mgr(); GuideMgr gMgr = new GuideMgr(); PersonMgr pMgr = new PersonMgr(); ClientMgr cMgr = new ClientMgr(); string strSQL = "SELECT Top 1 * FROM Sys_AddNumber WHERE AddNumberID = " + AddNumberID; DataTable dt = CMMgr.GetDataTable(strSQL); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; addNumber.AddNumberID = int.Parse(row["AddNumberID"].ToString()); addNumber.Title = row["Title"].ToString(); addNumber.Content = row["Content"].ToString(); addNumber.IsAudi = row["IsAudi"].ToString(); addNumber.Person = pMgr.GetPerson(row["PersonID"].ToString()); addNumber.Client = cMgr.GetClient(row["ClientID"].ToString()); addNumber.Guide2 = g2Mgr.GetGuide2(row["Guide2ID"].ToString()); addNumber.Guide = gMgr.GetGuide(row["GuideID"].ToString()); addNumber.AddInt = int.Parse(row["AddInt"].ToString()); return(addNumber); } else { return(addNumber); } }
protected void btnNew_Click(object sender, EventArgs e) { int intScale = 0; if (this.txtGuideName.Text.Trim() == "") { this.SendMessage("指标名称不能为空"); } else if (this.txtGuideCode.Text.Trim() == "") { this.SendMessage("指标编码不能为空"); } else { GuideMgr mgr = new GuideMgr(); Guide guide = new Guide(); guide.GuideName = this.txtGuideName.Text.Trim(); guide.GuideCode = this.txtGuideCode.Text.Trim(); this.txtGuideName.Text = ""; this.txtGuideCode.Text = ""; mgr.UpdateGuide(guide); this.initForm(); } }
/// <summary> /// 初始化人员列表信息 /// </summary> private void initForm() { GuideMgr mgr = new GuideMgr(); this.dgList.DataSource = mgr.GetGuideList(); this.dgList.DataBind(); }
protected void dgList_DeleteCommand(object source, DataGridCommandEventArgs e) { GuideMgr mgr = new GuideMgr(); mgr.DelGuide(e.Item.Cells[0].Text); this.initForm(); }
/// <summary> /// 获取一条Asses类信息 /// </summary> /// <param name="AssesID">登录编号</param> /// <returns>一条Asses类记录</returns> public Asses GetAsses(string AssesID) { Asses asses = new Asses(); GuideMgr gMgr = new GuideMgr(); Guide2Mgr g2Mgr = new Guide2Mgr(); PersonMgr pMgr = new PersonMgr(); string strSQL = "SELECT Top 1 * FROM Sys_Asses WHERE AssesID = " + AssesID; DataTable dt = CMMgr.GetDataTable(strSQL); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; asses.AssesID = int.Parse(row["AssesID"].ToString()); asses.Person = pMgr.GetPerson(row["PersonID"].ToString()); asses.Guide = gMgr.GetGuide(row["GuideID"].ToString()); asses.Guide2 = g2Mgr.GetGuide2(row["Guide2ID"].ToString()); asses.Scale1 = int.Parse(row["Scale1"].ToString()); asses.Scale2 = int.Parse(row["Scale2"].ToString()); asses.Scale3 = int.Parse(row["Scale3"].ToString()); asses.Scale1Name = row["Scale1Name"].ToString(); asses.Scale2Name = row["Scale2Name"].ToString(); asses.Scale3Name = row["Scale3Name"].ToString(); asses.CountNumber = int.Parse(row["CountNumber"].ToString()); asses.Memo = row["Memo"].ToString(); return(asses); } else { return(asses); } }
protected void btnOK_Click(object sender, EventArgs e) { AssesMgr sMgr = new AssesMgr(); Asses asses = new Asses(); GuideMgr gMgr = new GuideMgr(); if (this.hidAssesID.Value != "") { asses = sMgr.GetAsses(this.hidAssesID.Value); } asses.Person.PersonID = this.lstPersonID.SelectedValue; asses.Guide.GuideID = int.Parse(this.lstGuideID.SelectedValue); asses.Guide2.Guide2ID = int.Parse(this.lstGuide2ID.SelectedValue); asses.Scale1 = int.Parse(this.txtScale1.Text.Trim()); asses.Scale1Name = this.txtScale1Name.Text.Trim(); asses.Memo = this.txtMemo.Text; sMgr.UpdateAsses(asses); this.SendMessage("信息编辑成功"); if (this.hidAssesID.Value == "") { this.ClearTextData(this); } }
private void initGuide() { GuideMgr mgr = new GuideMgr(); this.lstGuideID.DataSource = mgr.GetGuideList(); this.lstGuideID.DataTextField = "GuideName"; this.lstGuideID.DataValueField = "GuideID"; this.lstGuideID.DataBind(); }
/// <summary> /// 获取一条Guide2类信息 /// </summary> /// <param name="Guide2ID">登录编号</param> /// <returns>一条Guide2类记录</returns> public Guide2 GetGuide2(string Guide2ID) { Guide2 guide2 = new Guide2(); GuideMgr gMgr = new GuideMgr(); string strSQL = "SELECT Top 1 * FROM Sys_Guide2 WHERE Guide2ID = " + Guide2ID; DataTable dt = CMMgr.GetDataTable(strSQL); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; guide2.Guide2ID = int.Parse(row["Guide2ID"].ToString()); guide2.Guide2Name = row["Guide2Name"].ToString(); guide2.Guide = gMgr.GetGuide(row["GuideID"].ToString()); return(guide2); } else { return(guide2); } }
protected void dgList_UpdateCommand(object source, DataGridCommandEventArgs e) { TextBox txtGuideName = (TextBox)e.Item.Cells[2].Controls[0]; int intScale = 0; if (txtGuideName.Text.Trim() == "") { this.SendMessage("请填写更改后的名称"); } else { GuideMgr mgr = new GuideMgr(); Guide guide = mgr.GetGuide(e.Item.Cells[0].Text); guide.GuideName = txtGuideName.Text.Trim(); guide.Scale = intScale; mgr.UpdateGuide(guide); this.dgList.EditItemIndex = -1; this.initForm(); } }
protected void dgList_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hyGuide1 = (HyperLink)e.Item.FindControl("hyGuide1"); HyperLink hyGuide2 = (HyperLink)e.Item.FindControl("hyGuide2"); HyperLink hyGuide3 = (HyperLink)e.Item.FindControl("hyGuide3"); GuideMgr gMgr = new GuideMgr(); Guide guide1 = gMgr.GetGuide("1"); Guide guide2 = gMgr.GetGuide("2"); Guide guide3 = gMgr.GetGuide("3"); hyGuide1.Text = "0"; hyGuide2.Text = "0"; hyGuide3.Text = "0"; PersonMgr mgr = new PersonMgr(); Person person = mgr.GetPerson(e.Item.Cells[0].Text); AssesMgr aMgr = new AssesMgr(); DataTable dt = aMgr.GetAssesNumberList(person.PersonID, 1); foreach (DataRow row in dt.Rows) { hyGuide1.Text = (int.Parse(hyGuide1.Text) + int.Parse(row["Scale1"].ToString())).ToString(); } if (hyGuide1.Text != "0") { if (int.Parse(hyGuide1.Text) > 100) { hyGuide1.Text = "100"; } hyGuide1.Text = (int.Parse(hyGuide1.Text) * guide1.Scale / 100).ToString(); } dt = aMgr.GetAssesNumberList(person.PersonID, 2); foreach (DataRow row in dt.Rows) { hyGuide2.Text = (int.Parse(hyGuide2.Text) + int.Parse(row["Scale1"].ToString())).ToString(); } if (hyGuide2.Text != "0") { if (int.Parse(hyGuide2.Text) > 100) { hyGuide2.Text = "100"; } hyGuide2.Text = (int.Parse(hyGuide2.Text) * guide2.Scale / 100).ToString(); } dt = aMgr.GetAssesNumberList(person.PersonID, 3); foreach (DataRow row in dt.Rows) { hyGuide3.Text = (int.Parse(hyGuide3.Text) + int.Parse(row["Scale1"].ToString())).ToString(); } if (hyGuide3.Text != "0") { if (int.Parse(hyGuide3.Text) > 100) { hyGuide3.Text = "100"; } hyGuide3.Text = (int.Parse(hyGuide3.Text) * guide3.Scale / 100).ToString(); } e.Item.Cells[e.Item.Cells.Count - 1].Text = (int.Parse(hyGuide1.Text) + int.Parse(hyGuide2.Text) + int.Parse(hyGuide3.Text)).ToString(); } }