protected void btnAll_Click(object sender, EventArgs e) { try { int j = 0; string[] filearray = new String[11]; filearray[0] = " "; for (int i = 0; i < gvMsg.Rows.Count; i++) { CheckBox ckb = gvMsg.Rows[i].FindControl("ckbChoose") as CheckBox; if (ckb.Checked == true) { int msgid = Convert.ToInt32(gvMsg.DataKeys[i].Value); MessageInfo msg = new MessageInfo(msgid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(msg.RecvEmployeeId)); MessageInfo.SendMail(em.Qq, "OA�µ���Ϣ", msg.EmployeeName + "," + msg.Msg); } } gvDataBind(); 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()) { string strTitle = Request.Form["txtTitle"].ToString(); string str = Request.Form["txtContent"].ToString(); string strSignName = Request.Form["txtSignName"].ToString(); string strNoticeTime = Request.Form["txtNoticeTime"].ToString(); EmployeeInfo em = (EmployeeInfo)Session["Employee"]; NoticeInfo notice = new NoticeInfo(); notice.EmployeeName = em.EmployeeName; notice.NoticeTitle = strTitle; notice.NoticeContent = str; notice.SignName = strSignName; notice.NoticeTime = strNoticeTime; notice.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('发布公告成功!');</script>"); DataTable EmTb = MessageInfo.getEmployeeId(em.EmployeeId); string[] strto = new String[EmTb.Rows.Count]; for (int i = 0; i < EmTb.Rows.Count; i++) { EmployeeInfo ems = new EmployeeInfo(Convert.ToInt32(EmTb.Rows[i]["EmployeeId"])); strto[i] = ems.Qq.ToString(); } MessageInfo.SendMailS(strto, "OA新的消息", "OA有新的公告"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { int msgid = Convert.ToInt32(((Button)sender).CommandArgument.ToString());; MessageInfo msg = new MessageInfo(msgid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(msg.RecvEmployeeId)); MessageInfo.SendMail(em.Qq, "OA�µ���Ϣ", msg.EmployeeName + "," + msg.Msg); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('���ѳɹ���');</script>"); }
protected void btnSubmit_Click(object sender, EventArgs e) { int TechMaScoreId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); TechMaScoreInfo tms = new TechMaScoreInfo(TechMaScoreId); tms.IsSubmit = 1; int recvid = Convert.ToInt32(Common.getEmployeeIdOfManager()); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(tms.EmployeeId)); EmployeeInfo ems = new EmployeeInfo(recvid); MessageInfo.Msgs1(recvid, tms.TechMaScoreId, "~/Score/TechMaScoreApprove.aspx", em.EmployeeName + "����������", em.EmployeeName, "daiban", em.EmployeeName + "����������"); //MessageInfo.SendMail(ems.Qq, "����������", em.EmployeeName + "����������"); tms.Save(); gvDataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { int NsScoreId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); NurseScoreInfo ns = new NurseScoreInfo(NsScoreId); ns.IsSubmit = 1; int recvid = Convert.ToInt32(Common.getEmployeeIdOfAdmin()); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(ns.EmployeeId)); EmployeeInfo ems = new EmployeeInfo(recvid); MessageInfo.Msgs1(recvid, ns.NurseScoreId, "~/Score/NurseScoreApprove.aspx", em.EmployeeName + "����������", em.EmployeeName, "daiban", em.EmployeeName + "����������"); MessageInfo.SendMail(ems.Qq, "����������", em.EmployeeName + "����������"); ns.Save(); gvDataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { int AsScoreId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); AssistantScoreInfo at = new AssistantScoreInfo(AsScoreId); at.IsSubmit = 1; int recvid = Convert.ToInt32(Common.getEmployeeIdOfMarketManager()); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(at.EmployeeId)); EmployeeInfo ems = new EmployeeInfo(recvid); MessageInfo.Msgs1(recvid, at.AssistantScoreId, "~/Score/AsistantScoreApprove.aspx", em.EmployeeName + "����������", em.EmployeeName, "daiban", em.EmployeeName + "����������"); MessageInfo.SendMail(ems.Qq, "����������", em.EmployeeName + "����������"); at.Save(); gvDataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { int BasEmScoreId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); BasEmScoreInfo bas = new BasEmScoreInfo(BasEmScoreId); bas.IsSubmit = 1; int recvid = Convert.ToInt32(Common.getEmployeeIdOfMarketManager()); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(bas.EmployeeId)); EmployeeInfo ems = new EmployeeInfo(recvid); MessageInfo.Msgs1(recvid, bas.BasEmScoreId, "~/Score/BASEmApprove.aspx", em.EmployeeName + "����������", em.EmployeeName, "daiban", em.EmployeeName + "����������"); MessageInfo.SendMail(ems.Qq, "����������", em.EmployeeName + "����������"); bas.Save(); gvDataBind(); }
public EmployeeInfo GetEmployeeInfoById(int EmployeeId) { EmployeeInfo employeeInfo = null;// try { employeeInfo = new EmployeeInfo(EmployeeId); } catch (AppException) { return null; } return employeeInfo; }
protected void PageInit() { int opid = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo op = new OfferPriceInfo(opid); MainProjectCreateInfo project = new MainProjectCreateInfo(Convert.ToInt32(op.MainProjectCreateId)); lblProject.Text = project.ProjectName; lblProjectNum.Text = project.SheetNum; EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(op.EmployeeId)); lblEmployee.Text = em.EmployeeName.ToString(); lblFillTableDate.Text = op.FillTableDate.ToString(); txtManagerView.Text = op.MangerView.ToString(); txtSectionView.Text = op.SectionView.ToString(); rblType.SelectedValue = op.OfferPriceTypeId.ToString(); txtProjectDes.Text = op.ProjectDes.ToString(); lblMoneySum.Text = op.ProductMoneySum.ToString(); if (op.OfferFileId.ToString() == "") { btnDownLoad.Enabled = false; } if (op.MoneySum != null) { lblMoneySum.Text = op.MoneySum.ToString(); } lblSheetNum.Text = op.SheetNum.ToString(); if (op.MoneySum != null) { lblMoneySum.Text = op.MoneySum.ToString(); } if (op.BigMoney != null) { lblBigMoney.Text = op.BigMoney.ToString(); } if (op.IsSignName == 1) { imgMarket.Visible = true; } else if (op.IsSignName == 2) { imgMarket.Visible = true; imgManager.Visible = true; } }
protected void btnLogin_Click(object sender, EventArgs e) { string strUserName = Request["textuser"].ToString(); string strUserPsd = Request["password"].ToString(); //Console.WriteLine("ok"); //Console.WriteLine(strUserName + strUserName); //Response.Write("ok"); if (strUserName == "" || strUserPsd == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('�û����벻Ϊ��!');</script>"); } else { bool IsUserLogin = MasterInfo.IsUser(strUserName, strUserPsd); if (IsUserLogin) { int EmployeeId = Convert.ToInt32(EmployeeInfo.getEmployeeOfMaster(strUserName, strUserPsd)); EmployeeInfo em = new EmployeeInfo(EmployeeId); string strRoleName = DayInfo.getRoleNameOfMaster(strUserName); DepartInfo depart = new DepartInfo(em.DepartId); Session["userName"] = strUserName; Session["userPsd"] = strUserPsd; Session["Employee"] = em; Session["EmployeeId"] = em.EmployeeId; Session["EmployeeName"] = em.EmployeeName; Session["RoleName"] = strRoleName; Session["DepartName"] = depart.DepartName.ToString(); Session["DepartId"] = em.DepartId; Session["PositionId"] = em.PositionId; Response.Redirect("main.aspx"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('�û��������!');</script>"); } } }
protected void gvwBind() { int emid = Convert.ToInt32(Session["EmployeeId"]); int departid = Convert.ToInt32(Session["DepartId"]); int recvEmployeeId = Convert.ToInt32(DayInfo.getRecvEmployeeId(departid)); EmployeeInfo em = new EmployeeInfo(recvEmployeeId); lblRecvEmployee.Text = em.EmployeeName.ToString(); DataTable dt = DayInfo.getWeekSumListOfEmployee(emid); if (dt.Rows.Count == 0) { dt.Rows.Add(dt.NewRow()); UI.BindCtrl(dt.DefaultView, gvwWeekSum, AspNetPager1); gvwWeekSum.Rows[0].Visible = false; } else { UI.BindCtrl(dt.DefaultView, gvwWeekSum, AspNetPager1); } }
public void PageInit() { int TesId = Convert.ToInt32(Request["TechEmScoreId"].ToString()); TechEmScoreInfo tes = new TechEmScoreInfo(TesId); selfplan = tes.SelfPlan.ToString(); selfworktotal = tes.SelfWorkTotal.ToString(); selfworkspeed = tes.SelfWorkSpeed.ToString(); selfcommunicate = tes.SelfCommunicate.ToString(); selfdescipline = tes.SelfDescipline.ToString(); selfexecute = tes.SelfExecute.ToString(); selfroute = tes.SelfRoute.ToString(); selfprofession = tes.SelfProfession.ToString(); selfattitude = tes.SelfAttitude.ToString(); selfcomplex = tes.SelfComplex.ToString(); selfspeciality = tes.SelfSpeciality.ToString(); ddlYear.SelectedValue = tes.YearId.ToString(); ddlMonth.SelectedValue = tes.MonthId.ToString(); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(tes.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(Convert.ToInt32(em.PositionId))); lblPosition.Text = position.PositionName; }
protected void PageInit() { int dsid=Convert.ToInt32(Request["DriverScoreId"].ToString()); DriverScoreInfo ds=new DriverScoreInfo(dsid); EmployeeInfo em=new EmployeeInfo(Convert.ToInt32(ds.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); //ddlYear.SelectedValue=ds.YearId.ToString(); //ddlMonth.SelectedValue=ds.MonthId.ToString(); YearInfo year = new YearInfo(Convert.ToInt32(ds.YearId)); MonthInfo month = new MonthInfo(Convert.ToInt32(ds.MonthId)); lblDate.Text = year.YearName + "Äê" + month.MonthNames + "ÔÂ"; lblSelfds1.Text=ds.Selfds1.ToString(); lblSelfds2.Text=ds.Selfds2.ToString(); lblSelfds3.Text=ds.Selfds3.ToString(); lblSelfds4.Text=ds.Selfds4.ToString(); lblSelfds5.Text=ds.Selfds5.ToString(); lblSelfds6.Text=ds.Selfds6.ToString(); lblSelfds7.Text=ds.Selfds7.ToString(); lblSelfds8.Text=ds.Selfds8.ToString(); lblSelfds9.Text=ds.Selfds9.ToString(); lblSelfds10.Text=ds.Selfds10.ToString(); lblSelfds11.Text=ds.Selfds11.ToString(); lblSelfds12.Text=ds.Selfds12.ToString(); lblSelfds13.Text=ds.Selfds13.ToString(); lblSelfds14.Text=ds.Selfds14.ToString(); lblSelfds15.Text=ds.Selfds15.ToString(); lblSelfds16.Text=ds.Selfds16.ToString(); lblSelfds17.Text=ds.Selfds17.ToString(); lblSelfds18.Text=ds.Selfds18.ToString(); lblSelfds19.Text=ds.Selfds19.ToString(); lblSelfds20.Text=ds.Selfds20.ToString(); lblSelfds21.Text=ds.Selfds21.ToString(); lblSelfds22.Text=ds.Selfds22.ToString(); lblSelfds23.Text=ds.Selfds23.ToString(); lblUpds1.Text=ds.Upds1.ToString(); lblUpds2.Text=ds.Upds2.ToString(); lblUpds3.Text=ds.Upds3.ToString(); lblUpds4.Text=ds.Upds4.ToString(); lblUpds5.Text=ds.Upds5.ToString(); lblUpds6.Text=ds.Upds6.ToString(); lblUpds7.Text=ds.Upds7.ToString(); lblUpds8.Text=ds.Upds8.ToString(); lblUpds9.Text=ds.Upds9.ToString(); lblUpds10.Text=ds.Upds10.ToString(); lblUpds11.Text=ds.Upds11.ToString(); lblUpds12.Text=ds.Upds12.ToString(); lblUpds13.Text=ds.Upds13.ToString(); lblUpds14.Text=ds.Upds14.ToString(); lblUpds15.Text=ds.Upds15.ToString(); lblUpds16.Text=ds.Upds16.ToString(); lblUpds17.Text=ds.Upds17.ToString(); lblUpds18.Text=ds.Upds18.ToString(); lblUpds19.Text=ds.Upds19.ToString(); lblUpds20.Text=ds.Upds20.ToString(); lblUpds21.Text=ds.Upds21.ToString(); lblUpds22.Text=ds.Upds22.ToString(); lblUpds23.Text=ds.Upds23.ToString(); lblSectds1.Text=ds.Secds1.ToString(); lblSectds2.Text=ds.Secds2.ToString(); lblSectds3.Text=ds.Secds3.ToString(); lblSectds4.Text=ds.Secds4.ToString(); lblSectds5.Text=ds.Secds5.ToString(); lblSectds6.Text=ds.Secds6.ToString(); lblSectds7.Text=ds.Secds7.ToString(); lblSectds8.Text=ds.Secds8.ToString(); lblSectds9.Text=ds.Secds9.ToString(); lblSectds10.Text=ds.Secds10.ToString(); lblSectds11.Text=ds.Secds11.ToString(); lblSectds12.Text=ds.Secds12.ToString(); lblSectds13.Text=ds.Secds13.ToString(); lblSectds14.Text=ds.Secds14.ToString(); lblSectds15.Text=ds.Secds15.ToString(); lblSectds16.Text=ds.Secds16.ToString(); lblSectds17.Text=ds.Secds17.ToString(); lblSectds18.Text=ds.Secds18.ToString(); lblSectds19.Text=ds.Secds19.ToString(); lblSectds20.Text=ds.Secds20.ToString(); lblSectds21.Text=ds.Secds21.ToString(); lblSectds22.Text=ds.Secds22.ToString(); lblSectds23.Text=ds.Secds23.ToString(); lblTotalScore.Text = ds.TotalScore.ToString(); }
protected void PageInit() { int nsid = Convert.ToInt32(Request["NsScoreId"].ToString()); NurseScoreInfo ns = new NurseScoreInfo(nsid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(ns.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); ddlYear.SelectedValue = ns.YearId.ToString(); ddlMonth.SelectedValue = ns.MonthId.ToString(); Selfns1 = ns.Selfns1.ToString(); Selfns2 = ns.Selfns2.ToString(); Selfns3 = ns.Selfns3.ToString(); Selfns4 = ns.Selfns4.ToString(); Selfns5 = ns.Selfns5.ToString(); Selfns6 = ns.Selfns6.ToString(); Selfns7 = ns.Selfns7.ToString(); Selfns8 = ns.Selfns8.ToString(); Selfns9 = ns.Selfns9.ToString(); Selfns10 = ns.Selfns10.ToString(); Selfns11 = ns.Selfns11.ToString(); Selfns12 = ns.Selfns12.ToString(); Selfns13 = ns.Selfns13.ToString(); Selfns14 = ns.Selfns14.ToString(); Selfns15 = ns.Selfns15.ToString(); Selfns16 = ns.Selfns16.ToString(); Selfns17 = ns.Selfns17.ToString(); Selfns18 = ns.Selfns18.ToString(); Selfns19 = ns.Selfns19.ToString(); Selfns20 = ns.Selfns20.ToString(); Selfns21 = ns.Selfns21.ToString(); Selfns22 = ns.Selfns22.ToString(); Selfns23 = ns.Selfns23.ToString(); }
public object SaveEmployeeInfo(EmployeeInfo employeeInfo) { employeeInfo.Save(); return employeeInfo . EmployeeId; }
public void DeleteById(EmployeeInfo pEmployeeInfo) { EmployeeInfo employeeInfo = new EmployeeInfo(pEmployeeInfo.EmployeeId); employeeInfo.Delete(); }
protected void PageInit() { int basid = Convert.ToInt32(Request["BasEmScoreId"].ToString()); BasEmScoreInfo bas = new BasEmScoreInfo(basid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(bas.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); //ddlYear.SelectedValue = bas.YearId.ToString(); //ddlMonth.SelectedValue = bas.MonthId.ToString(); YearInfo year = new YearInfo(Convert.ToInt32(bas.YearId)); MonthInfo month = new MonthInfo(Convert.ToInt32(bas.MonthId)); lblDate.Text = year.YearName + "��" + month.MonthNames + "��"; lblSelfbas1.Text = bas.Selfbas1.ToString(); lblSelfbas2.Text = bas.Selfbas2.ToString(); lblSelfbas3.Text = bas.Selfbas3.ToString(); lblSelfbas4.Text = bas.Selfbas4.ToString(); lblSelfbas5.Text = bas.Selfbas5.ToString(); lblSelfbas6.Text = bas.Selfbas6.ToString(); lblSelfbas7.Text = bas.Selfbas7.ToString(); lblSelfbas8.Text = bas.Selfbas8.ToString(); lblSelfbas9.Text = bas.Selfbas9.ToString(); lblSelfbas10.Text = bas.Selfbas10.ToString(); lblSelfbas11.Text = bas.Selfbas11.ToString(); lblSelfbas12.Text = bas.Selfbas12.ToString(); lblSelfbas13.Text = bas.Selfbas13.ToString(); lblSelfbas14.Text = bas.Selfbas14.ToString(); lblSelfbas15.Text = bas.Selfbas15.ToString(); lblSelfbas16.Text = bas.Selfbas16.ToString(); lblSelfbas17.Text = bas.Selfbas17.ToString(); }
protected void btnSendFile_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int emid = Convert.ToInt32(Session["EmployeeId"]); EmployeeInfo em = (EmployeeInfo)Session["Employee"]; //��ȡ�ļ��� string name = this.UpFile.FileName; DateTime sendtime = DateTime.Now; if (!CanYou.OA.BLL.FileInfo.IsFileSame(name)) { string[] strto = new String[lbxRecv.Items.Count]; for (int i = 0; i < lbxRecv.Items.Count; i++) { CanYou.OA.BLL.FileInfo file = new CanYou.OA.BLL.FileInfo(); file.RecvEmployeeId = Convert.ToInt32(lbxRecv.Items[i].Value); file.FileName = name; file.FileTypeId = Convert.ToInt32(ddlFileType.SelectedValue.ToString()); file.SendEmployeeId = emid; file.Memo = txtMemo.Text.ToString(); file.SendTime = sendtime; file.IsCommon = 0; file.IsDelete = 0; file.IsMsg = 0; file.Save(); MessageInfo Msg = new MessageInfo(); Msg.Msg = "���յ����ļ�:"+name; Msg.Url = "~/ShareManage/RecvFile.aspx"; Msg.RecvEmployeeId = Convert.ToInt32(lbxRecv.Items[i].Value); Msg.Memo = file.FileId.ToString(); Msg.EmployeeName = em.EmployeeName; Msg.MsgType = "daiyue"; Msg.MsgTime = DateTime.Now.ToString("yyyy-MM-dd"); Msg.MsgTitle = name; Msg.Save(); EmployeeInfo ems = new EmployeeInfo(Convert.ToInt32(lbxRecv.Items[0].Value)); strto[i] = ems.Qq.ToString(); } //�ļ��ϴ���ַ��Ŀ¼������ͨ��IIS���豾������ΪFTP������ //string FileSaveUri = @"ftp://192.168.11.70/www/Files/File/"; ////FTP�û������룬���DZ������û������� //string ftpUser = "******"; //string ftpPassWord = "******"; //SendFiles(FileSaveUri, ftpUser, ftpPassWord); this.UpFile.PostedFile.SaveAs(Server.MapPath("~/Files/File/" + UpFile.FileName)); MessageInfo.SendMailS(strto, "OA����Ϣ", "���յ����ļ�"); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('���ͳɹ���');</script>"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('���ļ����Ѵ��ڣ�����������');</script>"); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + ex.Message + "');", true); } } }
/// <summary> /// 复制为另一个对象 /// </summary> /// <param name="pIndustryTypeInfoTo"></param> public void CopyTo(EmployeeInfo pEmployeeInfoTo) { Copy(this, pEmployeeInfoTo); }
/// <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<EmployeeInfo> GetPagedList(int pPageIndex,int pPageSize,SortDirection pOrderBy,string pSortExpression,out int pRecordCount) { if(pPageIndex<=1) pPageIndex=1; List< EmployeeInfo> list = new List< EmployeeInfo>(); Query q = Employee .CreateQuery(); q.PageIndex = pPageIndex; q.PageSize = pPageSize; q.ORDER_BY(pSortExpression,pOrderBy.ToString()); EmployeeCollection collection=new EmployeeCollection(); collection.LoadAndCloseReader(q.ExecuteReader()); foreach (Employee employee in collection) { EmployeeInfo employeeInfo = new EmployeeInfo(); LoadFromDAL(employeeInfo, employee); list.Add(employeeInfo); } pRecordCount=q.GetRecordCount(); return list; }
/// <summary> /// 获得数据列表 /// </summary> /// <returns></returns> public static List<EmployeeInfo> GetList() { string cacheKey = GetCacheKey(); //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取 if (CachedEntityCommander.IsTypeRegistered(typeof(EmployeeInfo)) && CachedEntityCommander.GetCache(cacheKey) != null) { return CachedEntityCommander.GetCache(cacheKey) as List< EmployeeInfo>; } else { List< EmployeeInfo> list =new List< EmployeeInfo>(); EmployeeCollection collection=new EmployeeCollection(); Query qry = new Query(Employee.Schema); collection.LoadAndCloseReader(qry.ExecuteReader()); foreach(Employee employee in collection) { EmployeeInfo employeeInfo= new EmployeeInfo(); LoadFromDAL(employeeInfo,employee); list.Add(employeeInfo); } //生成缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(EmployeeInfo))) { CachedEntityCommander.SetCache(cacheKey, list); } return list; } }
/// <summary> /// 复制一个对象,采用硬编码的方式,避免反射的低效 /// </summary> /// <param name="pIndustryTypeInfoFrom"></param> /// <param name="pIndustryTypeInfoTo"></param> public static void Copy(EmployeeInfo pEmployeeInfoFrom, EmployeeInfo pEmployeeInfoTo) { pEmployeeInfoTo.EmployeeId = pEmployeeInfoFrom.employeeId; pEmployeeInfoTo.ContactId = pEmployeeInfoFrom.contactId; pEmployeeInfoTo.EmployeeName = pEmployeeInfoFrom.employeeName; pEmployeeInfoTo.PositionId = pEmployeeInfoFrom.positionId; pEmployeeInfoTo.Sex = pEmployeeInfoFrom.sex; pEmployeeInfoTo.Birthday = pEmployeeInfoFrom.birthday; pEmployeeInfoTo.Marrage = pEmployeeInfoFrom.marrage; pEmployeeInfoTo.Address = pEmployeeInfoFrom.address; pEmployeeInfoTo.NativePlace = pEmployeeInfoFrom.nativePlace; pEmployeeInfoTo.PoliticsId = pEmployeeInfoFrom.politicsId; pEmployeeInfoTo.IdentyNum = pEmployeeInfoFrom.identyNum; pEmployeeInfoTo.School = pEmployeeInfoFrom.school; pEmployeeInfoTo.Major = pEmployeeInfoFrom.major; pEmployeeInfoTo.EducationId = pEmployeeInfoFrom.educationId; pEmployeeInfoTo.LanguageId = pEmployeeInfoFrom.languageId; pEmployeeInfoTo.Certificate = pEmployeeInfoFrom.certificate; pEmployeeInfoTo.JobTime = pEmployeeInfoFrom.jobTime; pEmployeeInfoTo.JoinTime = pEmployeeInfoFrom.joinTime; pEmployeeInfoTo.DepartId = pEmployeeInfoFrom.departId; pEmployeeInfoTo.State = pEmployeeInfoFrom.state; pEmployeeInfoTo.OffJobTime = pEmployeeInfoFrom.offJobTime; pEmployeeInfoTo.Image = pEmployeeInfoFrom.image; pEmployeeInfoTo.Qq = pEmployeeInfoFrom.qq; pEmployeeInfoTo.TurnTime = pEmployeeInfoFrom.turnTime; pEmployeeInfoTo.EmLevelId = pEmployeeInfoFrom.emLevelId; pEmployeeInfoTo.EmDangId = pEmployeeInfoFrom.emDangId; pEmployeeInfoTo.Loaded=pEmployeeInfoFrom.Loaded; }
protected void PageInit() { int fsid = Convert.ToInt32(Request["FrontScoreId"].ToString()); FrontScoreInfo fs = new FrontScoreInfo(fsid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(fs.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); //ddlYear.SelectedValue = fs.YearId.ToString(); //ddlMonth.SelectedValue = fs.MonthId.ToString(); YearInfo year = new YearInfo(Convert.ToInt32(fs.YearId)); MonthInfo month = new MonthInfo(Convert.ToInt32(fs.MonthId)); lblDate.Text = year.YearName + "��" + month.MonthNames + "��"; lblSelffs1.Text = fs.Selffs1.ToString(); lblSelffs2.Text = fs.Selffs2.ToString(); lblSelffs3.Text = fs.Selffs3.ToString(); lblSelffs4.Text = fs.Selffs4.ToString(); lblSelffs5.Text = fs.Selffs5.ToString(); lblSelffs6.Text = fs.Selffs6.ToString(); lblSelffs7.Text = fs.Selffs7.ToString(); lblSelffs9.Text = fs.Selffs9.ToString(); lblSelffs10.Text = fs.Selffs10.ToString(); lblSelffs11.Text = fs.Selffs11.ToString(); lblSelffs12.Text = fs.Selffs12.ToString(); lblSelffs13.Text = fs.Selffs13.ToString(); lblSelffs14.Text = fs.Selffs14.ToString(); lblSelffs15.Text = fs.Selffs15.ToString(); lblSelffs16.Text = fs.Selffs16.ToString(); lblSelffs17.Text = fs.Selffs17.ToString(); lblSelffs18.Text = fs.Selffs18.ToString(); lblSelffs19.Text = fs.Selffs19.ToString(); lblSelffs20.Text = fs.Selffs20.ToString(); lblSelffs21.Text = fs.Selffs21.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["SortExpression"] = "Today"; ViewState["SortDir"] = "ASC"; ViewState["BackUrl"] = Request.UrlReferrer.ToString(); ViewState["wkid"] = Convert.ToInt32(Request["WeekScoreId"]); gvDataBind(); WeekScoreInfo wk = new WeekScoreInfo(Convert.ToInt32(ViewState["wkid"])); lblNum.Text = wk.WeekScoreNum.ToString(); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(wk.EmployeeId)); lblEm.Text = em.EmployeeName.ToString(); } }
//从后台获取数据 internal static void LoadFromDAL(EmployeeInfo pEmployeeInfo, Employee pEmployee) { pEmployeeInfo.employeeId = pEmployee.EmployeeId; pEmployeeInfo.contactId = pEmployee.ContactId; pEmployeeInfo.employeeName = pEmployee.EmployeeName; pEmployeeInfo.positionId = pEmployee.PositionId; pEmployeeInfo.sex = pEmployee.Sex; pEmployeeInfo.birthday = pEmployee.Birthday; pEmployeeInfo.marrage = pEmployee.Marrage; pEmployeeInfo.address = pEmployee.Address; pEmployeeInfo.nativePlace = pEmployee.NativePlace; pEmployeeInfo.politicsId = pEmployee.PoliticsId; pEmployeeInfo.identyNum = pEmployee.IdentyNum; pEmployeeInfo.school = pEmployee.School; pEmployeeInfo.major = pEmployee.Major; pEmployeeInfo.educationId = pEmployee.EducationId; pEmployeeInfo.languageId = pEmployee.LanguageId; pEmployeeInfo.certificate = pEmployee.Certificate; pEmployeeInfo.jobTime = pEmployee.JobTime; pEmployeeInfo.joinTime = pEmployee.JoinTime; pEmployeeInfo.departId = pEmployee.DepartId; pEmployeeInfo.state = pEmployee.State; pEmployeeInfo.offJobTime = pEmployee.OffJobTime; pEmployeeInfo.image = pEmployee.Image; pEmployeeInfo.qq = pEmployee.Qq; pEmployeeInfo.turnTime = pEmployee.TurnTime; pEmployeeInfo.emLevelId = pEmployee.EmLevelId; pEmployeeInfo.emDangId = pEmployee.EmDangId; pEmployeeInfo.Loaded=true; }
protected void PageInit() { int asid = Convert.ToInt32(Request["AssistantScoreId"].ToString()); AssistantScoreInfo at = new AssistantScoreInfo(asid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(at.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); YearInfo year = new YearInfo(Convert.ToInt32(at.YearId)); MonthInfo month = new MonthInfo(Convert.ToInt32(at.MonthId)); lblDate.Text = year.YearName + "��" + month.MonthNames + "��"; lblSelfas1.Text = at.Selfas1.ToString(); lblSelfas2.Text = at.Selfas2.ToString(); lblSelfas3.Text = at.Selfas3.ToString(); lblSelfas4.Text = at.Selfas4.ToString(); lblSelfas5.Text = at.Selfas5.ToString(); lblSelfas6.Text = at.Selfas6.ToString(); lblSelfas7.Text = at.Selfas7.ToString(); lblSelfas8.Text = at.Selfas8.ToString(); lblSelfas9.Text = at.Selfas9.ToString(); lblSelfas10.Text = at.Selfas10.ToString(); lblSelfas11.Text = at.Selfas11.ToString(); lblSelfas12.Text = at.Selfas12.ToString(); lblSelfas13.Text = at.Selfas13.ToString(); lblSelfas14.Text = at.Selfas14.ToString(); lblSelfas15.Text = at.Selfas15.ToString(); lblSelfas16.Text = at.Selfas16.ToString(); lblSelfas17.Text = at.Selfas17.ToString(); lblSelfas18.Text = at.Selfas18.ToString(); lblSelfas19.Text = at.Selfas19.ToString(); }
protected void PageInit() { int dsid = Convert.ToInt32(Request["DsScoreId"].ToString()); DriverScoreInfo ds = new DriverScoreInfo(dsid); EmployeeInfo em = new EmployeeInfo(Convert.ToInt32(ds.EmployeeId)); lblName.Text = em.EmployeeName.ToString(); PositionInfo position = new PositionInfo(Convert.ToInt32(em.PositionId)); lblPosition.Text = position.PositionName.ToString(); DepartInfo depart = new DepartInfo(Convert.ToInt32(em.DepartId)); lblDepart.Text = depart.DepartName.ToString(); ddlYear.SelectedValue = ds.YearId.ToString(); ddlMonth.SelectedValue = ds.MonthId.ToString(); Selfds1 = ds.Selfds1.ToString(); Selfds2 = ds.Selfds2.ToString(); Selfds3 = ds.Selfds3.ToString(); Selfds4 = ds.Selfds4.ToString(); Selfds5 = ds.Selfds5.ToString(); Selfds6 = ds.Selfds6.ToString(); Selfds7 = ds.Selfds7.ToString(); Selfds8 = ds.Selfds8.ToString(); Selfds9 = ds.Selfds9.ToString(); Selfds10 = ds.Selfds10.ToString(); Selfds11 = ds.Selfds11.ToString(); Selfds12 = ds.Selfds12.ToString(); Selfds13 = ds.Selfds13.ToString(); Selfds14 = ds.Selfds14.ToString(); Selfds15 = ds.Selfds15.ToString(); Selfds16 = ds.Selfds16.ToString(); Selfds17 = ds.Selfds17.ToString(); Selfds18 = ds.Selfds18.ToString(); Selfds19 = ds.Selfds19.ToString(); Selfds20 = ds.Selfds20.ToString(); Selfds21 = ds.Selfds21.ToString(); Selfds22 = ds.Selfds22.ToString(); Selfds23 = ds.Selfds23.ToString(); }
/// <summary> /// 批量装载 /// </summary> internal static void LoadFromDALPatch(List< EmployeeInfo> pList, EmployeeCollection pCollection) { foreach (Employee employee in pCollection) { EmployeeInfo employeeInfo = new EmployeeInfo(); LoadFromDAL(employeeInfo, employee ); pList.Add(employeeInfo); } }
protected void gvEmployee_RowDeleting(object sender, GridViewDeleteEventArgs e) { int emid = Convert.ToInt32(gvEmployee.DataKeys[e.RowIndex]["EmployeeId"]); EmployeeInfo em = new EmployeeInfo(emid); int contactid=em.ContactId; try { EmployeeInfo.EmployeeDel(Convert.ToInt32(gvEmployee.DataKeys[e.RowIndex]["EmployeeId"])); gvDataBind(); if (Convert.ToString(contactid) !="") { ContactInfo.DelContact(contactid); } } catch (Exception Ex) { lblMsg.Text = Ex.Message; } }
//数据持久化 internal static void SaveToDb(EmployeeInfo pEmployeeInfo, Employee pEmployee,bool pIsNew) { pEmployee.EmployeeId = pEmployeeInfo.employeeId; pEmployee.ContactId = pEmployeeInfo.contactId; pEmployee.EmployeeName = pEmployeeInfo.employeeName; pEmployee.PositionId = pEmployeeInfo.positionId; pEmployee.Sex = pEmployeeInfo.sex; pEmployee.Birthday = pEmployeeInfo.birthday; pEmployee.Marrage = pEmployeeInfo.marrage; pEmployee.Address = pEmployeeInfo.address; pEmployee.NativePlace = pEmployeeInfo.nativePlace; pEmployee.PoliticsId = pEmployeeInfo.politicsId; pEmployee.IdentyNum = pEmployeeInfo.identyNum; pEmployee.School = pEmployeeInfo.school; pEmployee.Major = pEmployeeInfo.major; pEmployee.EducationId = pEmployeeInfo.educationId; pEmployee.LanguageId = pEmployeeInfo.languageId; pEmployee.Certificate = pEmployeeInfo.certificate; pEmployee.JobTime = pEmployeeInfo.jobTime; pEmployee.JoinTime = pEmployeeInfo.joinTime; pEmployee.DepartId = pEmployeeInfo.departId; pEmployee.State = pEmployeeInfo.state; pEmployee.OffJobTime = pEmployeeInfo.offJobTime; pEmployee.Image = pEmployeeInfo.image; pEmployee.Qq = pEmployeeInfo.qq; pEmployee.TurnTime = pEmployeeInfo.turnTime; pEmployee.EmLevelId = pEmployeeInfo.emLevelId; pEmployee.EmDangId = pEmployeeInfo.emDangId; pEmployee.IsNew=pIsNew; string UserName = SubsonicHelper.GetUserName(); try { pEmployee.Save(UserName); } catch(Exception ex) { LogManager.getInstance().getLogger(typeof(EmployeeInfo)).Error(ex); if(ex.Message.Contains("插入重复键"))//违反了唯一键 { throw new AppException("此对象已经存在");//此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示 } throw new AppException("保存失败"); } pEmployeeInfo.employeeId = pEmployee.EmployeeId; //如果缓存存在,更新缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(EmployeeInfo))) { ResetCache(); } }