protected void btnSave_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); be.IsApply2 = 1; DateTime dt = DateTime.Now; be.Apply2Time = dt; if (rblOver.Items[0].Selected) { be.IsOver2 = 0; be.IsNewCreate = 1; } else { be.IsOver2 = 1; } be.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����ɹ���');</script>"); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true); } }
/// <summary> /// 获得数据列表 /// </summary> /// <returns></returns> public static List <BusinessExpInfo> GetList() { string cacheKey = GetCacheKey(); //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo)) && CachedEntityCommander.GetCache(cacheKey) != null) { return(CachedEntityCommander.GetCache(cacheKey) as List <BusinessExpInfo>); } else { List <BusinessExpInfo> list = new List <BusinessExpInfo>(); BusinessExpCollection collection = new BusinessExpCollection(); Query qry = new Query(BusinessExp.Schema); collection.LoadAndCloseReader(qry.ExecuteReader()); foreach (BusinessExp businessExp in collection) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(); LoadFromDAL(businessExpInfo, businessExp); list.Add(businessExpInfo); } //生成缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo))) { CachedEntityCommander.SetCache(cacheKey, list); } return(list); } }
protected void btnAddSheet_Click(object sender, EventArgs e) { BusinessExpInfo bExp = new BusinessExpInfo(); bExp.Save(); int bExpId = Convert.ToInt32(bExp.BusinessExpId); Response.Redirect("AddTreat.aspx?BusinessExpId="+bExpId); }
/// <summary> /// 获得分页列表,无论是否是缓存实体都从数据库直接拿取数据 /// </summary> /// <param name="pPageIndex">页数</param> /// <param name="pPageSize">每页列表</param> /// <param name="pOrderBy">排序</param> /// <param name="pSortExpression">排序字段</param> /// <param name="pRecordCount">列表行数</param> /// <returns>数据分页</returns> public static List <BusinessExpInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount) { if (pPageIndex <= 1) { pPageIndex = 1; } List <BusinessExpInfo> list = new List <BusinessExpInfo>(); Query q = BusinessExp.CreateQuery(); q.PageIndex = pPageIndex; q.PageSize = pPageSize; q.ORDER_BY(pSortExpression, pOrderBy.ToString()); BusinessExpCollection collection = new BusinessExpCollection(); collection.LoadAndCloseReader(q.ExecuteReader()); foreach (BusinessExp businessExp in collection) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(); LoadFromDAL(businessExpInfo, businessExp); list.Add(businessExpInfo); } pRecordCount = q.GetRecordCount(); return(list); }
protected void PageInit() { int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); lblApplyDate.Text = be.ApplyDate.ToString(); lblApplyPeople.Text = be.ApplyPeople.ToString(); lblDepart.Text = be.Depart.ToString(); lblMemo.Text = be.Memo.ToString(); txtReason.Text = be.ReasonExp.ToString(); lblItem1.Text = be.Item1.ToString(); lblItem2.Text = be.Item2.ToString(); lblItem3.Text = be.Item3.ToString(); lblItem4.Text = be.Item4.ToString(); lblMoney1.Text = be.Money1.ToString(); lblMoney2.Text = be.Money2.ToString(); lblMoney3.Text = be.Money3.ToString(); lblMoney4.Text = be.Money4.ToString(); lblMoneySum.Text = be.MoneySum.ToString(); lblSheetNum.Text = be.SheetNum.ToString(); if (be.SignName == 1) { imgMarket.Visible = true; } else if (be.SignName == 2) { imgMarket.Visible = true; imgManager.Visible = true; } }
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e) { //Check if this is our Blank Row being databound, if so make the row invisible if (e.Row.RowType == DataControlRowType.DataRow) { if (((DataRowView)e.Row.DataItem)["BusinessExpId"].ToString() == String.Empty) e.Row.Visible = false; } if (e.Row.RowType == DataControlRowType.DataRow) { //����ƶ���ÿ��ʱ��ɫ����Ч�� e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c1ebff'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e"); //�����������ָ����״Ϊ"С��" e.Row.Attributes["style"] = "Cursor:hand"; } if (e.Row.RowType == DataControlRowType.DataRow) { Label lblState = e.Row.FindControl("lblState") as Label; GridView gvTemp = (GridView)sender; if (!Convert.IsDBNull(gvTemp.DataKeys[e.Row.RowIndex].Value)) { int SaleId = Convert.ToInt32(gvTemp.DataKeys[e.Row.RowIndex].Value); BusinessExpInfo pc = new BusinessExpInfo(SaleId); if (pc.IsApprove == 0) { lblState.Text = "�г���:���� �ܾ���:����"; } else if (pc.IsApprove == 1 && pc.IsApply1 == 0) { if (pc.PreIsOver == 1) { lblState.Text = "�г���:ͨ�� �ܾ���:����"; } else { lblState.Text = "�г���:����"; } } else if (pc.IsApply1 == 1 && pc.IsApply2 == 0) { if (pc.IsOver1 == 1) { lblState.Text = "�г���:ͨ�� �ܾ���:ͨ��"; } else { lblState.Text = "�г���:ͨ�� �ܾ���:����"; } } } } }
/// <summary> /// 批量装载 /// </summary> internal static void LoadFromDALPatch(List <BusinessExpInfo> pList, BusinessExpCollection pCollection) { foreach (BusinessExp businessExp in pCollection) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(); LoadFromDAL(businessExpInfo, businessExp); pList.Add(businessExpInfo); } }
//从后台获取数据 internal static void LoadFromDAL(BusinessExpInfo pBusinessExpInfo, BusinessExp pBusinessExp) { pBusinessExpInfo.businessExpId = pBusinessExp.BusinessExpId; pBusinessExpInfo.mainBusinessExpId = pBusinessExp.MainBusinessExpId; pBusinessExpInfo.sheetNum = pBusinessExp.SheetNum; pBusinessExpInfo.applyPeople = pBusinessExp.ApplyPeople; pBusinessExpInfo.depart = pBusinessExp.Depart; pBusinessExpInfo.memo = pBusinessExp.Memo; pBusinessExpInfo.employee1Id = pBusinessExp.Employee1Id; pBusinessExpInfo.employee2Id = pBusinessExp.Employee2Id; pBusinessExpInfo.reasonExp = pBusinessExp.ReasonExp; pBusinessExpInfo.applyDate = pBusinessExp.ApplyDate; pBusinessExpInfo.preIsApply = pBusinessExp.PreIsApply; pBusinessExpInfo.isApprove = pBusinessExp.IsApprove; pBusinessExpInfo.isApply = pBusinessExp.IsApply; pBusinessExpInfo.isApply1 = pBusinessExp.IsApply1; pBusinessExpInfo.isApply2 = pBusinessExp.IsApply2; pBusinessExpInfo.preIsOver = pBusinessExp.PreIsOver; pBusinessExpInfo.isOver1 = pBusinessExp.IsOver1; pBusinessExpInfo.isOver2 = pBusinessExp.IsOver2; pBusinessExpInfo.preApplyTime = pBusinessExp.PreApplyTime; pBusinessExpInfo.approveTime = pBusinessExp.ApproveTime; pBusinessExpInfo.applyTime = pBusinessExp.ApplyTime; pBusinessExpInfo.apply1Time = pBusinessExp.Apply1Time; pBusinessExpInfo.apply2Time = pBusinessExp.Apply2Time; pBusinessExpInfo.preEmployeeId = pBusinessExp.PreEmployeeId; pBusinessExpInfo.sendEmployeeId = pBusinessExp.SendEmployeeId; pBusinessExpInfo.recvEmployeeId = pBusinessExp.RecvEmployeeId; pBusinessExpInfo.recv1EmployeeId = pBusinessExp.Recv1EmployeeId; pBusinessExpInfo.recv2EmployeeId = pBusinessExp.Recv2EmployeeId; pBusinessExpInfo.sendEmployeeName = pBusinessExp.SendEmployeeName; pBusinessExpInfo.recv1EmployeeName = pBusinessExp.Recv1EmployeeName; pBusinessExpInfo.recv2EmployeeName = pBusinessExp.Recv2EmployeeName; pBusinessExpInfo.preEmployeeName = pBusinessExp.PreEmployeeName; pBusinessExpInfo.recvEmployeeName = pBusinessExp.RecvEmployeeName; pBusinessExpInfo.isNewCreate = pBusinessExp.IsNewCreate; pBusinessExpInfo.isMain = pBusinessExp.IsMain; pBusinessExpInfo.isMain1 = pBusinessExp.IsMain1; pBusinessExpInfo.isMain2 = pBusinessExp.IsMain2; pBusinessExpInfo.isMain3 = pBusinessExp.IsMain3; pBusinessExpInfo.moneySum = pBusinessExp.MoneySum; pBusinessExpInfo.today = pBusinessExp.Today; pBusinessExpInfo.signName = pBusinessExp.SignName; pBusinessExpInfo.item1 = pBusinessExp.Item1; pBusinessExpInfo.item2 = pBusinessExp.Item2; pBusinessExpInfo.item3 = pBusinessExp.Item3; pBusinessExpInfo.item4 = pBusinessExp.Item4; pBusinessExpInfo.money1 = pBusinessExp.Money1; pBusinessExpInfo.money2 = pBusinessExp.Money2; pBusinessExpInfo.money3 = pBusinessExp.Money3; pBusinessExpInfo.money4 = pBusinessExp.Money4; pBusinessExpInfo.Loaded = true; }
/// <summary> /// 复制一个对象,采用硬编码的方式,避免反射的低效 /// </summary> /// <param name="pIndustryTypeInfoFrom"></param> /// <param name="pIndustryTypeInfoTo"></param> public static void Copy(BusinessExpInfo pBusinessExpInfoFrom, BusinessExpInfo pBusinessExpInfoTo) { pBusinessExpInfoTo.BusinessExpId = pBusinessExpInfoFrom.businessExpId; pBusinessExpInfoTo.MainBusinessExpId = pBusinessExpInfoFrom.mainBusinessExpId; pBusinessExpInfoTo.SheetNum = pBusinessExpInfoFrom.sheetNum; pBusinessExpInfoTo.ApplyPeople = pBusinessExpInfoFrom.applyPeople; pBusinessExpInfoTo.Depart = pBusinessExpInfoFrom.depart; pBusinessExpInfoTo.Memo = pBusinessExpInfoFrom.memo; pBusinessExpInfoTo.Employee1Id = pBusinessExpInfoFrom.employee1Id; pBusinessExpInfoTo.Employee2Id = pBusinessExpInfoFrom.employee2Id; pBusinessExpInfoTo.ReasonExp = pBusinessExpInfoFrom.reasonExp; pBusinessExpInfoTo.ApplyDate = pBusinessExpInfoFrom.applyDate; pBusinessExpInfoTo.PreIsApply = pBusinessExpInfoFrom.preIsApply; pBusinessExpInfoTo.IsApprove = pBusinessExpInfoFrom.isApprove; pBusinessExpInfoTo.IsApply = pBusinessExpInfoFrom.isApply; pBusinessExpInfoTo.IsApply1 = pBusinessExpInfoFrom.isApply1; pBusinessExpInfoTo.IsApply2 = pBusinessExpInfoFrom.isApply2; pBusinessExpInfoTo.PreIsOver = pBusinessExpInfoFrom.preIsOver; pBusinessExpInfoTo.IsOver1 = pBusinessExpInfoFrom.isOver1; pBusinessExpInfoTo.IsOver2 = pBusinessExpInfoFrom.isOver2; pBusinessExpInfoTo.PreApplyTime = pBusinessExpInfoFrom.preApplyTime; pBusinessExpInfoTo.ApproveTime = pBusinessExpInfoFrom.approveTime; pBusinessExpInfoTo.ApplyTime = pBusinessExpInfoFrom.applyTime; pBusinessExpInfoTo.Apply1Time = pBusinessExpInfoFrom.apply1Time; pBusinessExpInfoTo.Apply2Time = pBusinessExpInfoFrom.apply2Time; pBusinessExpInfoTo.PreEmployeeId = pBusinessExpInfoFrom.preEmployeeId; pBusinessExpInfoTo.SendEmployeeId = pBusinessExpInfoFrom.sendEmployeeId; pBusinessExpInfoTo.RecvEmployeeId = pBusinessExpInfoFrom.recvEmployeeId; pBusinessExpInfoTo.Recv1EmployeeId = pBusinessExpInfoFrom.recv1EmployeeId; pBusinessExpInfoTo.Recv2EmployeeId = pBusinessExpInfoFrom.recv2EmployeeId; pBusinessExpInfoTo.SendEmployeeName = pBusinessExpInfoFrom.sendEmployeeName; pBusinessExpInfoTo.Recv1EmployeeName = pBusinessExpInfoFrom.recv1EmployeeName; pBusinessExpInfoTo.Recv2EmployeeName = pBusinessExpInfoFrom.recv2EmployeeName; pBusinessExpInfoTo.PreEmployeeName = pBusinessExpInfoFrom.preEmployeeName; pBusinessExpInfoTo.RecvEmployeeName = pBusinessExpInfoFrom.recvEmployeeName; pBusinessExpInfoTo.IsNewCreate = pBusinessExpInfoFrom.isNewCreate; pBusinessExpInfoTo.IsMain = pBusinessExpInfoFrom.isMain; pBusinessExpInfoTo.IsMain1 = pBusinessExpInfoFrom.isMain1; pBusinessExpInfoTo.IsMain2 = pBusinessExpInfoFrom.isMain2; pBusinessExpInfoTo.IsMain3 = pBusinessExpInfoFrom.isMain3; pBusinessExpInfoTo.MoneySum = pBusinessExpInfoFrom.moneySum; pBusinessExpInfoTo.Today = pBusinessExpInfoFrom.today; pBusinessExpInfoTo.SignName = pBusinessExpInfoFrom.signName; pBusinessExpInfoTo.Item1 = pBusinessExpInfoFrom.item1; pBusinessExpInfoTo.Item2 = pBusinessExpInfoFrom.item2; pBusinessExpInfoTo.Item3 = pBusinessExpInfoFrom.item3; pBusinessExpInfoTo.Item4 = pBusinessExpInfoFrom.item4; pBusinessExpInfoTo.Money1 = pBusinessExpInfoFrom.money1; pBusinessExpInfoTo.Money2 = pBusinessExpInfoFrom.money2; pBusinessExpInfoTo.Money3 = pBusinessExpInfoFrom.money3; pBusinessExpInfoTo.Money4 = pBusinessExpInfoFrom.money4; pBusinessExpInfoTo.Loaded = pBusinessExpInfoFrom.Loaded; }
public BusinessExpInfo GetBusinessExpInfoById(int BusinessExpId) { BusinessExpInfo businessExpInfo = null;// try { businessExpInfo = new BusinessExpInfo(BusinessExpId); } catch (AppException) { return null; } return businessExpInfo; }
public BusinessExpInfo GetBusinessExpInfoById(int BusinessExpId) { BusinessExpInfo businessExpInfo = null; // try { businessExpInfo = new BusinessExpInfo(BusinessExpId); } catch (AppException) { return(null); } return(businessExpInfo); }
protected void btnSubmit_Click(object sender, EventArgs e) { int wksumId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); BusinessExpInfo wksum = new BusinessExpInfo(wksumId); wksum.IsApply = 1; DateTime date = DateTime.Now; wksum.ApplyTime = date; int recvemid = Convert.ToInt32(Common.getEmployeeIdOfManager());//ֻ���ܾ����ܽ��շ�������� wksum.Recv1EmployeeId = recvemid; wksum.Save(); gvDataBind(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����ɹ���');</script>"); }
protected void BusinessBind() { int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); lblApplyDate.Text = be.ApplyDate.ToString(); lblApplyPeople.Text = be.ApplyPeople.ToString(); lblDepart.Text = be.Depart.ToString(); lblMemo.Text = be.Memo.ToString(); lblReason.Text = be.ReasonExp.ToString(); lblItem1.Text = be.Item1.ToString(); lblItem2.Text = be.Item2.ToString(); lblItem3.Text = be.Item3.ToString(); lblItem4.Text = be.Item4.ToString(); lblMoney1.Text = be.Money1.ToString(); lblMoney2.Text = be.Money2.ToString(); lblMoney3.Text = be.Money3.ToString(); lblMoney4.Text = be.Money4.ToString(); lblMoneySum.Text = be.MoneySum.ToString(); lblSheetNum.Text = be.SheetNum.ToString(); }
private void LoadFromId(int businessExpId) { if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo))) { BusinessExpInfo businessExpInfo = Find(GetList(), businessExpId); if (businessExpInfo == null) { throw new AppException("未能在缓存中找到相应的键值对象"); } Copy(businessExpInfo, this); } else { BusinessExp businessExp = new BusinessExp(businessExpId); if (businessExp.IsNew) { throw new AppException("尚未初始化"); } LoadFromDAL(this, businessExp); } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { EmployeeInfo em = (EmployeeInfo)Session["Employee"]; int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); be.IsApply1 = 1; be.SignName = 2; DateTime dt = DateTime.Now; be.Apply1Time = dt; if (rblOver.Items[0].Selected) { be.IsOver1 = 0; be.IsNewCreate = 1; be.Save(); MessageInfo.DelMessageOfMemo(id.ToString()); } else { be.IsOver1 = 1; be.Save(); } Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����ɹ���');</script>"); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int wkid = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo pc = new BusinessExpInfo(wkid); pc.IsApprove = 1; pc.SignName = 1; DateTime date = DateTime.Now; pc.ApproveTime = date; if (rblOver.Items[0].Selected) { pc.PreIsOver = 0; pc.IsNewCreate = 1; pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����������������');</script>"); } else if (rblOver.Items[1].Selected) { pc.PreIsOver = 1; int emid = Convert.ToInt32(Common.getEmployeeIdOfManager());//������� pc.Recv1EmployeeId = emid; pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����ͨ����');</script>"); } } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true); } } }
/// <summary> /// 批量装载 /// </summary> internal static void LoadFromDALPatch(List< BusinessExpInfo> pList, BusinessExpCollection pCollection) { foreach (BusinessExp businessExp in pCollection) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(); LoadFromDAL(businessExpInfo, businessExp ); pList.Add(businessExpInfo); } }
//数据持久化 internal static void SaveToDb(BusinessExpInfo pBusinessExpInfo, BusinessExp pBusinessExp,bool pIsNew) { pBusinessExp.BusinessExpId = pBusinessExpInfo.businessExpId; pBusinessExp.MainBusinessExpId = pBusinessExpInfo.mainBusinessExpId; pBusinessExp.SheetNum = pBusinessExpInfo.sheetNum; pBusinessExp.ApplyPeople = pBusinessExpInfo.applyPeople; pBusinessExp.Depart = pBusinessExpInfo.depart; pBusinessExp.Memo = pBusinessExpInfo.memo; pBusinessExp.Employee1Id = pBusinessExpInfo.employee1Id; pBusinessExp.Employee2Id = pBusinessExpInfo.employee2Id; pBusinessExp.ReasonExp = pBusinessExpInfo.reasonExp; pBusinessExp.ApplyDate = pBusinessExpInfo.applyDate; pBusinessExp.PreIsApply = pBusinessExpInfo.preIsApply; pBusinessExp.IsApprove = pBusinessExpInfo.isApprove; pBusinessExp.IsApply = pBusinessExpInfo.isApply; pBusinessExp.IsApply1 = pBusinessExpInfo.isApply1; pBusinessExp.IsApply2 = pBusinessExpInfo.isApply2; pBusinessExp.PreIsOver = pBusinessExpInfo.preIsOver; pBusinessExp.IsOver1 = pBusinessExpInfo.isOver1; pBusinessExp.IsOver2 = pBusinessExpInfo.isOver2; pBusinessExp.PreApplyTime = pBusinessExpInfo.preApplyTime; pBusinessExp.ApproveTime = pBusinessExpInfo.approveTime; pBusinessExp.ApplyTime = pBusinessExpInfo.applyTime; pBusinessExp.Apply1Time = pBusinessExpInfo.apply1Time; pBusinessExp.Apply2Time = pBusinessExpInfo.apply2Time; pBusinessExp.PreEmployeeId = pBusinessExpInfo.preEmployeeId; pBusinessExp.SendEmployeeId = pBusinessExpInfo.sendEmployeeId; pBusinessExp.RecvEmployeeId = pBusinessExpInfo.recvEmployeeId; pBusinessExp.Recv1EmployeeId = pBusinessExpInfo.recv1EmployeeId; pBusinessExp.Recv2EmployeeId = pBusinessExpInfo.recv2EmployeeId; pBusinessExp.SendEmployeeName = pBusinessExpInfo.sendEmployeeName; pBusinessExp.Recv1EmployeeName = pBusinessExpInfo.recv1EmployeeName; pBusinessExp.Recv2EmployeeName = pBusinessExpInfo.recv2EmployeeName; pBusinessExp.PreEmployeeName = pBusinessExpInfo.preEmployeeName; pBusinessExp.RecvEmployeeName = pBusinessExpInfo.recvEmployeeName; pBusinessExp.IsNewCreate = pBusinessExpInfo.isNewCreate; pBusinessExp.IsMain = pBusinessExpInfo.isMain; pBusinessExp.IsMain1 = pBusinessExpInfo.isMain1; pBusinessExp.IsMain2 = pBusinessExpInfo.isMain2; pBusinessExp.IsMain3 = pBusinessExpInfo.isMain3; pBusinessExp.MoneySum = pBusinessExpInfo.moneySum; pBusinessExp.Today = pBusinessExpInfo.today; pBusinessExp.SignName = pBusinessExpInfo.signName; pBusinessExp.Item1 = pBusinessExpInfo.item1; pBusinessExp.Item2 = pBusinessExpInfo.item2; pBusinessExp.Item3 = pBusinessExpInfo.item3; pBusinessExp.Item4 = pBusinessExpInfo.item4; pBusinessExp.Money1 = pBusinessExpInfo.money1; pBusinessExp.Money2 = pBusinessExpInfo.money2; pBusinessExp.Money3 = pBusinessExpInfo.money3; pBusinessExp.Money4 = pBusinessExpInfo.money4; pBusinessExp.IsNew=pIsNew; string UserName = SubsonicHelper.GetUserName(); try { pBusinessExp.Save(UserName); } catch(Exception ex) { LogManager.getInstance().getLogger(typeof(BusinessExpInfo)).Error(ex); if(ex.Message.Contains("插入重复键"))//违反了唯一键 { throw new AppException("此对象已经存在");//此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示 } throw new AppException("保存失败"); } pBusinessExpInfo.businessExpId = pBusinessExp.BusinessExpId; //如果缓存存在,更新缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo))) { ResetCache(); } }
public void DeleteById(BusinessExpInfo pBusinessExpInfo) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(pBusinessExpInfo.BusinessExpId); businessExpInfo.Delete(); }
//从后台获取数据 internal static void LoadFromDAL(BusinessExpInfo pBusinessExpInfo, BusinessExp pBusinessExp) { pBusinessExpInfo.businessExpId = pBusinessExp.BusinessExpId; pBusinessExpInfo.mainBusinessExpId = pBusinessExp.MainBusinessExpId; pBusinessExpInfo.sheetNum = pBusinessExp.SheetNum; pBusinessExpInfo.applyPeople = pBusinessExp.ApplyPeople; pBusinessExpInfo.depart = pBusinessExp.Depart; pBusinessExpInfo.memo = pBusinessExp.Memo; pBusinessExpInfo.employee1Id = pBusinessExp.Employee1Id; pBusinessExpInfo.employee2Id = pBusinessExp.Employee2Id; pBusinessExpInfo.reasonExp = pBusinessExp.ReasonExp; pBusinessExpInfo.applyDate = pBusinessExp.ApplyDate; pBusinessExpInfo.preIsApply = pBusinessExp.PreIsApply; pBusinessExpInfo.isApprove = pBusinessExp.IsApprove; pBusinessExpInfo.isApply = pBusinessExp.IsApply; pBusinessExpInfo.isApply1 = pBusinessExp.IsApply1; pBusinessExpInfo.isApply2 = pBusinessExp.IsApply2; pBusinessExpInfo.preIsOver = pBusinessExp.PreIsOver; pBusinessExpInfo.isOver1 = pBusinessExp.IsOver1; pBusinessExpInfo.isOver2 = pBusinessExp.IsOver2; pBusinessExpInfo.preApplyTime = pBusinessExp.PreApplyTime; pBusinessExpInfo.approveTime = pBusinessExp.ApproveTime; pBusinessExpInfo.applyTime = pBusinessExp.ApplyTime; pBusinessExpInfo.apply1Time = pBusinessExp.Apply1Time; pBusinessExpInfo.apply2Time = pBusinessExp.Apply2Time; pBusinessExpInfo.preEmployeeId = pBusinessExp.PreEmployeeId; pBusinessExpInfo.sendEmployeeId = pBusinessExp.SendEmployeeId; pBusinessExpInfo.recvEmployeeId = pBusinessExp.RecvEmployeeId; pBusinessExpInfo.recv1EmployeeId = pBusinessExp.Recv1EmployeeId; pBusinessExpInfo.recv2EmployeeId = pBusinessExp.Recv2EmployeeId; pBusinessExpInfo.sendEmployeeName = pBusinessExp.SendEmployeeName; pBusinessExpInfo.recv1EmployeeName = pBusinessExp.Recv1EmployeeName; pBusinessExpInfo.recv2EmployeeName = pBusinessExp.Recv2EmployeeName; pBusinessExpInfo.preEmployeeName = pBusinessExp.PreEmployeeName; pBusinessExpInfo.recvEmployeeName = pBusinessExp.RecvEmployeeName; pBusinessExpInfo.isNewCreate = pBusinessExp.IsNewCreate; pBusinessExpInfo.isMain = pBusinessExp.IsMain; pBusinessExpInfo.isMain1 = pBusinessExp.IsMain1; pBusinessExpInfo.isMain2 = pBusinessExp.IsMain2; pBusinessExpInfo.isMain3 = pBusinessExp.IsMain3; pBusinessExpInfo.moneySum = pBusinessExp.MoneySum; pBusinessExpInfo.today = pBusinessExp.Today; pBusinessExpInfo.signName = pBusinessExp.SignName; pBusinessExpInfo.item1 = pBusinessExp.Item1; pBusinessExpInfo.item2 = pBusinessExp.Item2; pBusinessExpInfo.item3 = pBusinessExp.Item3; pBusinessExpInfo.item4 = pBusinessExp.Item4; pBusinessExpInfo.money1 = pBusinessExp.Money1; pBusinessExpInfo.money2 = pBusinessExp.Money2; pBusinessExpInfo.money3 = pBusinessExp.Money3; pBusinessExpInfo.money4 = pBusinessExp.Money4; pBusinessExpInfo.Loaded=true; }
protected void gvBusiness_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblState = e.Row.FindControl("lblState") as Label; Button btnSubmit = e.Row.FindControl("btnSubmit") as Button; Button btnEdit = e.Row.FindControl("btnEdit") as Button; if (!Convert.IsDBNull(gvBusiness.DataKeys[e.Row.RowIndex].Value)) { //����GridView GridView gv = e.Row.FindControl("GridView2") as GridView; int emid = Convert.ToInt32(Session["EmployeeId"]); int SaleId = Convert.ToInt32(gvBusiness.DataKeys[e.Row.RowIndex].Value); BusinessExpInfo pc = new BusinessExpInfo(SaleId); int mainid = Convert.ToInt32(pc.MainBusinessExpId); DataTable dt = BusinessExpInfo.getBusinessExpListOfEmployee2(emid, mainid); if (dt.Rows.Count == 0) { dt.Rows.Add(dt.NewRow()); UI.BindCtrl(dt.DefaultView, gv, AspNetPager2); gv.Rows[0].Visible = false; } else { UI.BindCtrl(dt.DefaultView, gv, AspNetPager2); } //button���� if (pc.IsApply == 1) { btnSubmit.Enabled = false; if (pc.IsNewCreate == 1)//����δͨ���������� { btnEdit.Enabled = true; } else//Ĭ��IsNewCreate==0�������룬�༭��ť�����á� { btnEdit.Enabled = false; } } if (pc.IsApply == 1 && pc.IsApply1 == 0) { lblState.Text = "�ܾ���:����"; } else if (pc.IsApply1 == 1 && pc.IsApply2 == 0) { if (pc.IsOver1 == 1) { lblState.Text = "�ܾ���:ͨ��"; } else { lblState.Text = "�ܾ���:����"; } } } if (e.Row.RowType == DataControlRowType.DataRow) { //����ƶ���ÿ��ʱ��ɫ����Ч�� e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c1ebff'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e"); //�����������ָ����״Ϊ"С��" e.Row.Attributes["style"] = "Cursor:hand"; } } }
public object SaveBusinessExpInfo(BusinessExpInfo businessExpInfo) { businessExpInfo.Save(); return businessExpInfo . BusinessExpId; }
/// <summary> /// 获得分页列表,无论是否是缓存实体都从数据库直接拿取数据 /// </summary> /// <param name="pPageIndex">页数</param> /// <param name="pPageSize">每页列表</param> /// <param name="pOrderBy">排序</param> /// <param name="pSortExpression">排序字段</param> /// <param name="pRecordCount">列表行数</param> /// <returns>数据分页</returns> public static List<BusinessExpInfo> GetPagedList(int pPageIndex,int pPageSize,SortDirection pOrderBy,string pSortExpression,out int pRecordCount) { if(pPageIndex<=1) pPageIndex=1; List< BusinessExpInfo> list = new List< BusinessExpInfo>(); Query q = BusinessExp .CreateQuery(); q.PageIndex = pPageIndex; q.PageSize = pPageSize; q.ORDER_BY(pSortExpression,pOrderBy.ToString()); BusinessExpCollection collection=new BusinessExpCollection(); collection.LoadAndCloseReader(q.ExecuteReader()); foreach (BusinessExp businessExp in collection) { BusinessExpInfo businessExpInfo = new BusinessExpInfo(); LoadFromDAL(businessExpInfo, businessExp); list.Add(businessExpInfo); } pRecordCount=q.GetRecordCount(); return list; }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { EmployeeInfo em = (EmployeeInfo)Session["Employee"]; int emid = Convert.ToInt32(Session["EmployeeId"]); MainBusinessExpInfo main = new MainBusinessExpInfo(); main.Save(); int bExpId = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(bExpId); be.MainBusinessExpId = main.MainBusinessExpId; DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); be.Today = strtoday; be.SheetNum = txtSheetNum.Text.ToString(); be.ApplyDate=Convert.ToDateTime(txtApplyDate.Text.ToString()) ; be.ApplyPeople=lblApplyPeople.Text.ToString(); be.Depart=lblDepart.Text.ToString(); be.Memo=txtMemo.Text.ToString(); be.ReasonExp=txtReason.Text.ToString(); be.Item1 = txtItem1.Text.ToString(); be.Item2 = txtItem2.Text.ToString(); be.Item3 = txtItem3.Text.ToString(); be.Item4 = txtItem4.Text.ToString(); be.Money1 = txtMoney1.Text.ToString(); be.Money2 = txtMoney2.Text.ToString(); be.Money3 = txtMoney3.Text.ToString(); be.Money4 = txtMoney4.Text.ToString(); be.MoneySum = txtMoneySum.Text.ToString(); string strRoleName = Session["RoleName"].ToString(); if (strRoleName == "���ž���") { be.SendEmployeeName = em.EmployeeName; be.SendEmployeeId = emid; be.PreIsApply = 1; be.PreIsOver = 1; be.SignName = 1; } else { be.PreEmployeeId = em.EmployeeId; be.PreEmployeeName = em.EmployeeName; be.PreIsApply = 0; be.PreIsOver = 0; be.SignName = 0; } be.IsApply = 0; be.IsApprove = 0; be.IsApply1 = 0; be.IsApply2 = 0; be.IsOver1 = 0; be.IsOver2 = 0; //GridViewǶ���ж� be.IsMain = 1; be.IsMain1 = 1; be.IsMain2 = 1; be.IsMain3 = 1; be.IsNewCreate = 0; be.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('��ӳɹ���');</script>"); //ClearForms(); ViewState["Isbtn"] = "1"; txtSheetNum.Text = SheetNums.SheetNumOfBE("ZDFY", strtoday); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('���ʧ�ܣ�" + Ex.Message + "');", true); } } }
/// <summary> /// 复制一个对象,采用硬编码的方式,避免反射的低效 /// </summary> /// <param name="pIndustryTypeInfoFrom"></param> /// <param name="pIndustryTypeInfoTo"></param> public static void Copy(BusinessExpInfo pBusinessExpInfoFrom, BusinessExpInfo pBusinessExpInfoTo) { pBusinessExpInfoTo.BusinessExpId = pBusinessExpInfoFrom.businessExpId; pBusinessExpInfoTo.MainBusinessExpId = pBusinessExpInfoFrom.mainBusinessExpId; pBusinessExpInfoTo.SheetNum = pBusinessExpInfoFrom.sheetNum; pBusinessExpInfoTo.ApplyPeople = pBusinessExpInfoFrom.applyPeople; pBusinessExpInfoTo.Depart = pBusinessExpInfoFrom.depart; pBusinessExpInfoTo.Memo = pBusinessExpInfoFrom.memo; pBusinessExpInfoTo.Employee1Id = pBusinessExpInfoFrom.employee1Id; pBusinessExpInfoTo.Employee2Id = pBusinessExpInfoFrom.employee2Id; pBusinessExpInfoTo.ReasonExp = pBusinessExpInfoFrom.reasonExp; pBusinessExpInfoTo.ApplyDate = pBusinessExpInfoFrom.applyDate; pBusinessExpInfoTo.PreIsApply = pBusinessExpInfoFrom.preIsApply; pBusinessExpInfoTo.IsApprove = pBusinessExpInfoFrom.isApprove; pBusinessExpInfoTo.IsApply = pBusinessExpInfoFrom.isApply; pBusinessExpInfoTo.IsApply1 = pBusinessExpInfoFrom.isApply1; pBusinessExpInfoTo.IsApply2 = pBusinessExpInfoFrom.isApply2; pBusinessExpInfoTo.PreIsOver = pBusinessExpInfoFrom.preIsOver; pBusinessExpInfoTo.IsOver1 = pBusinessExpInfoFrom.isOver1; pBusinessExpInfoTo.IsOver2 = pBusinessExpInfoFrom.isOver2; pBusinessExpInfoTo.PreApplyTime = pBusinessExpInfoFrom.preApplyTime; pBusinessExpInfoTo.ApproveTime = pBusinessExpInfoFrom.approveTime; pBusinessExpInfoTo.ApplyTime = pBusinessExpInfoFrom.applyTime; pBusinessExpInfoTo.Apply1Time = pBusinessExpInfoFrom.apply1Time; pBusinessExpInfoTo.Apply2Time = pBusinessExpInfoFrom.apply2Time; pBusinessExpInfoTo.PreEmployeeId = pBusinessExpInfoFrom.preEmployeeId; pBusinessExpInfoTo.SendEmployeeId = pBusinessExpInfoFrom.sendEmployeeId; pBusinessExpInfoTo.RecvEmployeeId = pBusinessExpInfoFrom.recvEmployeeId; pBusinessExpInfoTo.Recv1EmployeeId = pBusinessExpInfoFrom.recv1EmployeeId; pBusinessExpInfoTo.Recv2EmployeeId = pBusinessExpInfoFrom.recv2EmployeeId; pBusinessExpInfoTo.SendEmployeeName = pBusinessExpInfoFrom.sendEmployeeName; pBusinessExpInfoTo.Recv1EmployeeName = pBusinessExpInfoFrom.recv1EmployeeName; pBusinessExpInfoTo.Recv2EmployeeName = pBusinessExpInfoFrom.recv2EmployeeName; pBusinessExpInfoTo.PreEmployeeName = pBusinessExpInfoFrom.preEmployeeName; pBusinessExpInfoTo.RecvEmployeeName = pBusinessExpInfoFrom.recvEmployeeName; pBusinessExpInfoTo.IsNewCreate = pBusinessExpInfoFrom.isNewCreate; pBusinessExpInfoTo.IsMain = pBusinessExpInfoFrom.isMain; pBusinessExpInfoTo.IsMain1 = pBusinessExpInfoFrom.isMain1; pBusinessExpInfoTo.IsMain2 = pBusinessExpInfoFrom.isMain2; pBusinessExpInfoTo.IsMain3 = pBusinessExpInfoFrom.isMain3; pBusinessExpInfoTo.MoneySum = pBusinessExpInfoFrom.moneySum; pBusinessExpInfoTo.Today = pBusinessExpInfoFrom.today; pBusinessExpInfoTo.SignName = pBusinessExpInfoFrom.signName; pBusinessExpInfoTo.Item1 = pBusinessExpInfoFrom.item1; pBusinessExpInfoTo.Item2 = pBusinessExpInfoFrom.item2; pBusinessExpInfoTo.Item3 = pBusinessExpInfoFrom.item3; pBusinessExpInfoTo.Item4 = pBusinessExpInfoFrom.item4; pBusinessExpInfoTo.Money1 = pBusinessExpInfoFrom.money1; pBusinessExpInfoTo.Money2 = pBusinessExpInfoFrom.money2; pBusinessExpInfoTo.Money3 = pBusinessExpInfoFrom.money3; pBusinessExpInfoTo.Money4 = pBusinessExpInfoFrom.money4; pBusinessExpInfoTo.Loaded=pBusinessExpInfoFrom.Loaded; }
/// <summary> /// 复制为另一个对象 /// </summary> /// <param name="pIndustryTypeInfoTo"></param> public void CopyTo(BusinessExpInfo pBusinessExpInfoTo) { Copy(this, pBusinessExpInfoTo); }
public object SaveBusinessExpInfo(BusinessExpInfo businessExpInfo) { businessExpInfo.Save(); return(businessExpInfo.BusinessExpId); }
protected void BusinessBind() { int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); txtSheetNum.Text = be.SheetNum.ToString(); txtApplyDate.Text = be.ApplyDate.ToString(); lblApplyPeople.Text = be.ApplyPeople.ToString(); lblDepart.Text = be.Depart.ToString(); txtMemo.Text = be.Memo.ToString(); txtReason.Text = be.ReasonExp.ToString(); txtItem1.Text = be.Item1.ToString(); txtItem2.Text = be.Item2.ToString(); txtItem3.Text = be.Item3.ToString(); txtItem4.Text = be.Item4.ToString(); txtMoney1.Text = be.Money1.ToString(); txtMoney2.Text = be.Money2.ToString(); txtMoney3.Text = be.Money3.ToString(); txtMoney4.Text = be.Money4.ToString(); txtMoneySum.Text = be.MoneySum.ToString(); EmployeeInfo em = (EmployeeInfo)Session["Employee"]; PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); string strRoleName = Session["RoleName"].ToString(); if (strRoleName == "Ա��" || position.PositionName == "�ۺ�����") { btnSign.Enabled = false; btnSign.Visible = false; } }
/// <summary> /// 获得数据列表 /// </summary> /// <returns></returns> public static List<BusinessExpInfo> GetList() { string cacheKey = GetCacheKey(); //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo)) && CachedEntityCommander.GetCache(cacheKey) != null) { return CachedEntityCommander.GetCache(cacheKey) as List< BusinessExpInfo>; } else { List< BusinessExpInfo> list =new List< BusinessExpInfo>(); BusinessExpCollection collection=new BusinessExpCollection(); Query qry = new Query(BusinessExp.Schema); collection.LoadAndCloseReader(qry.ExecuteReader()); foreach(BusinessExp businessExp in collection) { BusinessExpInfo businessExpInfo= new BusinessExpInfo(); LoadFromDAL(businessExpInfo,businessExp); list.Add(businessExpInfo); } //生成缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo))) { CachedEntityCommander.SetCache(cacheKey, list); } return list; } }
//数据持久化 internal static void SaveToDb(BusinessExpInfo pBusinessExpInfo, BusinessExp pBusinessExp, bool pIsNew) { pBusinessExp.BusinessExpId = pBusinessExpInfo.businessExpId; pBusinessExp.MainBusinessExpId = pBusinessExpInfo.mainBusinessExpId; pBusinessExp.SheetNum = pBusinessExpInfo.sheetNum; pBusinessExp.ApplyPeople = pBusinessExpInfo.applyPeople; pBusinessExp.Depart = pBusinessExpInfo.depart; pBusinessExp.Memo = pBusinessExpInfo.memo; pBusinessExp.Employee1Id = pBusinessExpInfo.employee1Id; pBusinessExp.Employee2Id = pBusinessExpInfo.employee2Id; pBusinessExp.ReasonExp = pBusinessExpInfo.reasonExp; pBusinessExp.ApplyDate = pBusinessExpInfo.applyDate; pBusinessExp.PreIsApply = pBusinessExpInfo.preIsApply; pBusinessExp.IsApprove = pBusinessExpInfo.isApprove; pBusinessExp.IsApply = pBusinessExpInfo.isApply; pBusinessExp.IsApply1 = pBusinessExpInfo.isApply1; pBusinessExp.IsApply2 = pBusinessExpInfo.isApply2; pBusinessExp.PreIsOver = pBusinessExpInfo.preIsOver; pBusinessExp.IsOver1 = pBusinessExpInfo.isOver1; pBusinessExp.IsOver2 = pBusinessExpInfo.isOver2; pBusinessExp.PreApplyTime = pBusinessExpInfo.preApplyTime; pBusinessExp.ApproveTime = pBusinessExpInfo.approveTime; pBusinessExp.ApplyTime = pBusinessExpInfo.applyTime; pBusinessExp.Apply1Time = pBusinessExpInfo.apply1Time; pBusinessExp.Apply2Time = pBusinessExpInfo.apply2Time; pBusinessExp.PreEmployeeId = pBusinessExpInfo.preEmployeeId; pBusinessExp.SendEmployeeId = pBusinessExpInfo.sendEmployeeId; pBusinessExp.RecvEmployeeId = pBusinessExpInfo.recvEmployeeId; pBusinessExp.Recv1EmployeeId = pBusinessExpInfo.recv1EmployeeId; pBusinessExp.Recv2EmployeeId = pBusinessExpInfo.recv2EmployeeId; pBusinessExp.SendEmployeeName = pBusinessExpInfo.sendEmployeeName; pBusinessExp.Recv1EmployeeName = pBusinessExpInfo.recv1EmployeeName; pBusinessExp.Recv2EmployeeName = pBusinessExpInfo.recv2EmployeeName; pBusinessExp.PreEmployeeName = pBusinessExpInfo.preEmployeeName; pBusinessExp.RecvEmployeeName = pBusinessExpInfo.recvEmployeeName; pBusinessExp.IsNewCreate = pBusinessExpInfo.isNewCreate; pBusinessExp.IsMain = pBusinessExpInfo.isMain; pBusinessExp.IsMain1 = pBusinessExpInfo.isMain1; pBusinessExp.IsMain2 = pBusinessExpInfo.isMain2; pBusinessExp.IsMain3 = pBusinessExpInfo.isMain3; pBusinessExp.MoneySum = pBusinessExpInfo.moneySum; pBusinessExp.Today = pBusinessExpInfo.today; pBusinessExp.SignName = pBusinessExpInfo.signName; pBusinessExp.Item1 = pBusinessExpInfo.item1; pBusinessExp.Item2 = pBusinessExpInfo.item2; pBusinessExp.Item3 = pBusinessExpInfo.item3; pBusinessExp.Item4 = pBusinessExpInfo.item4; pBusinessExp.Money1 = pBusinessExpInfo.money1; pBusinessExp.Money2 = pBusinessExpInfo.money2; pBusinessExp.Money3 = pBusinessExpInfo.money3; pBusinessExp.Money4 = pBusinessExpInfo.money4; pBusinessExp.IsNew = pIsNew; string UserName = SubsonicHelper.GetUserName(); try { pBusinessExp.Save(UserName); } catch (Exception ex) { LogManager.getInstance().getLogger(typeof(BusinessExpInfo)).Error(ex); if (ex.Message.Contains("插入重复键")) //违反了唯一键 { throw new AppException("此对象已经存在"); //此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示 } throw new AppException("保存失败"); } pBusinessExpInfo.businessExpId = pBusinessExp.BusinessExpId; //如果缓存存在,更新缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(BusinessExpInfo))) { ResetCache(); } }
public List <BusinessExpInfo> GetBusinessExpInfoList() { return(BusinessExpInfo.GetList()); }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int id = Convert.ToInt32(Request["BusinessExpId"].ToString()); BusinessExpInfo be = new BusinessExpInfo(id); if (be.IsNewCreate == 1) { be.IsMain = 0; be.IsMain1 = 0; be.IsMain2 = 0; be.IsMain3 = 0; BusinessExpInfo benew = new BusinessExpInfo(); benew.IsNewCreate = 0; benew.IsMain = 1; benew.IsMain1 = 1; benew.IsMain2 = 1; benew.IsMain3 = 1; benew.MainBusinessExpId = be.MainBusinessExpId; string strRoleName = Session["RoleName"].ToString(); if (strRoleName == "���ž���") { benew.SendEmployeeId = be.SendEmployeeId; benew.SendEmployeeName = be.SendEmployeeName; benew.PreIsApply = 1; benew.PreIsOver = 1; benew.SignName = 1; } else { benew.PreEmployeeId = be.PreEmployeeId; benew.PreEmployeeName = be.PreEmployeeName; benew.PreIsApply = 0; benew.PreIsOver = 0; benew.SignName = 0; } benew.IsApply = 0; benew.IsApprove = 0; benew.IsApply1 = 0; benew.IsApply2 = 0; benew.IsOver1 = 0; benew.IsOver2 = 0; benew.SignName = 0; DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); benew.Today = strtoday; benew.SheetNum = txtSheetNum.Text.ToString(); benew.ApplyDate = Convert.ToDateTime(txtApplyDate.Text.ToString()); benew.ApplyPeople = lblApplyPeople.Text.ToString(); benew.Depart = lblDepart.Text.ToString(); benew.Memo = txtMemo.Text.ToString(); benew.ReasonExp = txtReason.Text.ToString(); benew.Item1 = txtItem1.Text.ToString(); benew.Item2 = txtItem2.Text.ToString(); benew.Item3 = txtItem3.Text.ToString(); benew.Item4 = txtItem4.Text.ToString(); benew.Money1 = txtMoney1.Text.ToString(); benew.Money2 = txtMoney2.Text.ToString(); benew.Money3 = txtMoney3.Text.ToString(); benew.Money4 = txtMoney4.Text.ToString(); benew.MoneySum = txtMoneySum.Text.ToString(); benew.Save(); be.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('�����ɹ���');</script>"); } else { be.ApplyDate = Convert.ToDateTime(txtApplyDate.Text.ToString()); be.ApplyPeople = lblApplyPeople.Text.ToString(); be.Depart = lblDepart.Text.ToString(); be.Memo = txtMemo.Text.ToString(); be.ReasonExp = txtReason.Text.ToString(); be.Item1 = txtItem1.Text.ToString(); be.Item2 = txtItem2.Text.ToString(); be.Item3 = txtItem3.Text.ToString(); be.Item4 = txtItem4.Text.ToString(); be.Money1 = txtMoney1.Text.ToString(); be.Money2 = txtMoney2.Text.ToString(); be.Money3 = txtMoney3.Text.ToString(); be.Money4 = txtMoney4.Text.ToString(); be.MoneySum = txtMoneySum.Text.ToString(); be.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('�༭�ɹ���');</script>"); } } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('���ʧ�ܣ�" + Ex.Message + "');", true); } } }
public List <BusinessExpInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount) { return(BusinessExpInfo.GetPagedList(pPageIndex, pPageSize, pOrderBy, pSortExpression, out pRecordCount)); }