protected void btnDelete_Click(object sender, EventArgs e) { int i; int intDeleteOk = 0; int intDeleteError = 0; TemplatedColumn tcol = (TemplatedColumn)this.UltraWebGridEvectionApply.Bands[0].Columns[0]; for (i = 0; i < this.UltraWebGridEvectionApply.Rows.Count; i++) { CellItem GridItem = (CellItem)tcol.CellItems[i]; CheckBox chkIsHaveRight = (CheckBox)GridItem.FindControl("CheckBoxCell"); if (chkIsHaveRight.Checked) { logmodel.ProcessFlag = "delete"; model.ID = this.UltraWebGridEvectionApply.Rows[i].Cells.FromKey("ID").Text.Trim(); int flag = bll.DeleteEevctionByKey(model, logmodel); if (flag == 1) { intDeleteOk++; } else { intDeleteError++; } } } if ((intDeleteOk + intDeleteError) > 0) { string alertText = Message.DeleteSuccess + ":" + intDeleteOk + "," + Message.DeleteFailed + ":" + intDeleteError; Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + alertText + "')", true); } pager.CurrentPageIndex = 1; model = new KQMEvectionApplyModel(); DataUIBind(); }
protected void btnExport_Click(object sender, EventArgs e) { if (ImportFlag.Value == "2") { if (dt.Rows.Count != 0) { model = PageHelper.GetModel<KQMEvectionApplyModel>(pnlContent.Controls); List<KQMEvectionApplyModel> list = bll.GetList(dt); string[] header = { ControlText.gvErrorMsg, ControlText.gvWorkNo,ControlText.gvEvectionTypeName, ControlText.gvEvectionReason, ControlText.gvEvectionTime, ControlText.gvEvectionTel, ControlText.gvEvectionAddress, ControlText.gvEvectionTask,ControlText.gvEvectionRoad, ControlText.gvReturnTime, ControlText.gvEvectionBy,ControlText.gvRemark, }; string[] properties = { "ErrorMsg","WorkNo","EvectionTypeName", "EvectionReason", "EvectionTime", "EvectionTel", "EvectionAddress", "EvectionTask", "EvectionRoad", "ReturnTime", "EvectionBy","Remark"}; string filePath = MapPath("~/ExportFileTemp/") + DateTime.Now.Ticks + ".xls"; NPOIHelper.ExportExcel(list, header, properties, 5000, filePath, true); PageHelper.ReturnHTTPStream(filePath, true); } else { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.NoDataExport + "')", true); } } else { if (dt.Rows.Count != 0) { model = PageHelper.GetModel<KQMEvectionApplyModel>(pnlContent.Controls); dt = bll.GetEvectionList(model); List<KQMEvectionApplyModel> list = bll.GetList(dt); string[] header = {ControlText.gvHeadOrderID, ControlText.gvBillNo, ControlText.gvWorkNo, ControlText.gvLocalName, ControlText.gvDepName,ControlText.gvEvectionTypeName, ControlText.gvEvectionReason, ControlText.gvEvectionTime, ControlText.gvEvectionTel, ControlText.gvEvectionAddress, ControlText.gvEvectionTask,ControlText.gvEvectionRoad, ControlText.gvReturnTime, ControlText.gvEvectionBy, ControlText.gvMotorMan, ControlText.gvRemark,ControlText.gvStatusName, ControlText.gvApprover, ControlText.gvApproverDate,ControlText.gvAuditer,ControlText.gvAuditDate,ControlText.gvAuditIdea, ControlText.gvCreateUser,ControlText.gvCreateDate}; string[] properties = { "ID", "BillNo", "WorkNo", "LocalName", "DepName", "EvectionTypeName", "EvectionReason", "EvectionTime", "EvectionTel", "EvectionAddress", "EvectionTask", "EvectionRoad", "ReturnTime", "EvectionBy", "MotorMan", "Remark", "StatusName", "Approver", "ApproverDate", "Auditer", "AuditDate", "AuditIdea","CreateUser", "CreateDate"}; string filePath = MapPath("~/ExportFileTemp/") + DateTime.Now.Ticks + ".xls"; NPOIHelper.ExportExcel(list, header, properties, 5000, filePath, true); PageHelper.ReturnHTTPStream(filePath, true); } else { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.NoDataExport + "')", true); } } }
private void Query(string BillNo) { string condition = ""; //抓取簽核流程 condition = "and a.BillNo ='" + BillNo + "'"; this.dataSet = bll.GetAuditDataByCondition(condition); UltraWebGridStatus.DataSource = this.dataSet.Tables["WFM_AuditStatus"].DefaultView; UltraWebGridStatus.DataBind(); //獲取表頭基本信息 switch (this.HiddenBillTypeNo.Value) { //case "KQMLeaveApply"://請假申請簽核單OTE case "HolidayApplyC"://Holiday (<=5 day) HAC case "HolidayApplyD"://Holiday (>5 day) HAD case "HolidayApplyH"://Other leave HAH case "ExEvection"://國外出差申請簽核單OTE case "ExEvectionCancel"://國外銷差申請簽核單ERC case "CEMVacReportRequest"://述職/休假申請簽核單VRN case "InEvection"://國內出差申請簽核單 case "InEvectionCancel"://國內銷差申請簽核單 case "ETMCurriculaPlan"://課程規劃簽核單ECP //condition = "SELECT * FROM (select (case when (select BillTypeCode From BFW_BillType c Where c.BillTypeNo=substr(a.BillNo,0,3))='KQMLeaveApply' " + // "then (select BillTypeName From BFW_BillType c Where c.BillTypeNo=substr(a.BillNo,0,3))||'-'|| " + // "(select LVTypeName from KQM_LeaveType c where c.LVTypeCode= " + // "(select LVTypeCode from kqm_leaveapply d where d.BillNo=a.BillNo and rownum=1)) " + // "else (select BillTypeName From BFW_BillType c Where c.BillTypeCode=a.BillTypeCode) end) BillTypeName " + // "from WFM_Bill a " + // "Where a.BillNo ='" + BillNo + "')"; //this.labelBillTypeName.Text = ((eBFW.Sys.ServiceLocator)Session["serviceLocator"]).GetFunctionData().GetValue(condition); break; default: condition = "and a.BillNo ='" + BillNo + "'"; this.tempDataTable = bll.GetDataByCondition_Bill(condition).Tables["WFM_Bill"]; if (this.tempDataTable.Rows.Count > 0) { this.textBoxOrgName.Text = bll.GetAllDept(tempDataTable.Rows[0]["OrgCode"].ToString(), true); this.HiddenOrgCode.Value = tempDataTable.Rows[0]["OrgCode"].ToString(); this.textBoxApplyMan.Text = tempDataTable.Rows[0]["ApplyManName"].ToString(); if (tempDataTable.Rows[0]["ApplyDate"].ToString().Length > 0) { this.textBoxApplyDate.Text = string.Format("{0:" + System.Convert.ToString("yyyy/MM/dd") + "}", Convert.ToDateTime(tempDataTable.Rows[0]["ApplyDate"].ToString())); } this.labelBillTypeName.Text = tempDataTable.Rows[0]["BillTypeName"].ToString(); } else { Response.Write("<script type='text/javascript'>alert('" + Message.wfm_message_billdeleted + "');window.close();</script>"); return; } break; } string inWorkNum = "0", AdvanceNum = "0", LeaveNum = "0", Percent = "0"; switch (this.HiddenBillTypeNo.Value) { case "LeaveTypeA"://辭職申請簽核單LVA case "LeaveTypeB"://自離申請簽核單LVB case "ExEvection"://國外出差申請簽核單OTE case "ExEvectionCancel"://國外銷差申請簽核單ERC case "CEMVacReportRequest"://述職/休假申請簽核單VRN case "InEvection"://國內出差申請簽核單 case "InEvectionCancel"://國內銷差申請簽核單 case "ETMCurriculaPlan"://課程規劃簽核單ECP case "SCMRequire"://鞋櫃申請單SCM case "OrgMove"://調動申請MVB break; default: //今日在職人數 condition = "select count(1) from GDS_ATT_EMPLOYEE a where a.flag='Local' and a.Status='0' " + "and a.DCode in (SELECT DepCode FROM GDS_SC_DEPARTMENT START WITH " + "depcode='" + this.HiddenOrgCode.Value + "' CONNECT BY PRIOR depcode = parentdepcode) "; inWorkNum = bll.GetValue(condition); //今日加班預報人數 condition = "select count(1) from GDS_ATT_ADVANCEAPPLY a, GDS_ATT_EMPLOYEE b " + "where a.WorkNo=b.WorkNo and a.OTDate=trunc(sysdate) and b.flag='Local' and b.Status='0' " + "AND b.DCode in (SELECT DepCode FROM GDS_SC_DEPARTMENT START WITH " + "depcode='" + this.HiddenOrgCode.Value + "' CONNECT BY PRIOR depcode = parentdepcode) "; AdvanceNum = bll.GetValue(condition); //今日請假人數 condition = "select count(1) from GDS_ATT_LEAVEAPPLY a, GDS_ATT_EMPLOYEE b " + "where a.WorkNo=b.WorkNo and a.StartDate>=trunc(sysdate) and a.EndDate<=trunc(sysdate) " + "and b.flag='Local' and b.Status='0' " + "AND b.DCode in (SELECT DepCode FROM GDS_SC_DEPARTMENT START WITH " + "depcode='" + this.HiddenOrgCode.Value + "' CONNECT BY PRIOR depcode = parentdepcode) "; LeaveNum = bll.GetValue(condition); break; } switch (this.HiddenBillTypeNo.Value) { case "D001"://加班預報簽核單OTA 需要做的操作 case "OTMProjectApply": string isProject = bll.GetValue("Select nvl(Max(isProject),'N') from GDS_ATT_ADVANCEAPPLY where billno='" + BillNo + "' and rownum<=1"); if (isProject.Equals("Y")) { //this.labelBillTypeName.Text = ((eBFW.Sys.ServiceLocator)Session["serviceLocator"]).GetFunctionData().GetValue("Select BillTypeName From Bfw_BillType Where BillTypeCode='OTMAdvanceApplyG3'"); this.HiddenisProject.Value = isProject; } else { this.UltraWebGridOTA.Bands[0].Columns.FromKey("CheckBoxISPay").Hidden = true; } condition = ""; condition += "and a.BillNo ='" + BillNo + "'"; if (!this.HiddenSFlag.Value.Equals("Y")) { condition += " and a.Status='1'"; } this.dataSet = bll.GetDataByCondition(condition); UltraWebGridOTA.Visible = true; UltraWebGridOTA.DataSource = this.dataSet.Tables["OTM_AdvanceApply"].DefaultView; UltraWebGridOTA.DataBind(); try { Percent = Convert.ToString(System.Math.Round(Convert.ToDecimal(AdvanceNum) / Convert.ToDecimal(inWorkNum) * 100, 0)); } catch (System.Exception) { } this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_advancenum + AdvanceNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_advancepercent + Percent + "%;" + Message.wfm_billauditcount + this.dataSet.Tables["OTM_AdvanceApply"].Rows.Count.ToString(); break; case "KQMApplyOut"://外出申請簽核單KQT 需要做的操作 KQMEvectionApplyBll bllKQTOut = new KQMEvectionApplyBll(); KQMEvectionApplyModel modelKQTOut = new KQMEvectionApplyModel(); modelKQTOut.BillNo = BillNo; //condition += "and a.BillNo ='" + BillNo + "'"; DataTable dt = bllKQTOut.GetEvectionList(modelKQTOut); UltraWebGridKQT.Visible = true; UltraWebGridKQT.DataSource = dt.DefaultView; UltraWebGridKQT.DataBind(); this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_advancenum + AdvanceNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_advancepercent + Percent + "%;" + Message.wfm_billauditcount + dt.Rows.Count.ToString(); break; case "D002": KQMLeaveApplyExportBll kqmLeaveApply = new KQMLeaveApplyExportBll(); LeaveApplyViewModel leaveApplyViewModel = new LeaveApplyViewModel(); leaveApplyViewModel.BillNo = BillNo; DataTable dtLeaveApply = kqmLeaveApply.getLeaveApply(leaveApplyViewModel); UltraWebGridLeaveApply.Visible = true; UltraWebGridLeaveApply.DataSource = dtLeaveApply; UltraWebGridLeaveApply.DataBind(); this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_advancenum + AdvanceNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_advancepercent + Percent + "%;" + Message.wfm_billauditcount + dtLeaveApply.Rows.Count.ToString(); break; case "KQMException"://考勤異常簽核單KQE string Status = ""; condition = ""; condition += "and a.BillNo ='" + BillNo + "'"; if (!this.HiddenSFlag.Value.Equals("Y")) { Status = "4"; } Bll_AbnormalAttendanceHandle bll_signabnormal = new Bll_AbnormalAttendanceHandle(); DataTable dt_signabnormal = bll_signabnormal.GetSignAbnormalAttendanceInfo(BillNo, Status); UltraWebGridKQE.DataSource = dt_signabnormal; UltraWebGridKQE.DataBind(); UltraWebGridKQE.Visible = true; this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_billauditcount + dt_signabnormal.Rows.Count.ToString(); break; case "KQMMonthTotal"://外出申請簽核單KQT 需要做的操作 OTMTotalQryModel modelMonthTotal = new OTMTotalQryModel(); OTMTotalQryBll bllOTMQry = new OTMTotalQryBll(); modelMonthTotal.BillNo = BillNo; DataTable dt_monthtotal = bllOTMQry.GetOTMQryList(modelMonthTotal); UltraWebGridKQM.Visible = true; UltraWebGridKQM.DataSource = dt_monthtotal.DefaultView; UltraWebGridKQM.DataBind(); this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_advancenum + AdvanceNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_advancepercent + Percent + "%;" + Message.wfm_billauditcount + dt_monthtotal.Rows.Count.ToString(); break; #region 免卡人員加班 case "KQMOTMA": //免卡人員加班TMA Status = ""; condition = ""; condition += "and a.BillNo ='" + BillNo + "'"; if (!this.HiddenSFlag.Value.Equals("Y")) { Status = "1"; } OTMActivityApplyBll activityApplyBll = new OTMActivityApplyBll(); DataTable tmaTB = activityApplyBll.getAuditBillInfoByBillNo(condition, Status);// bll_signabnormal.GetSignAbnormalAttendanceInfo(BillNo, Status); UltraWebGridTMA.DataSource = tmaTB; UltraWebGridTMA.DataBind(); UltraWebGridTMA.Visible = true; this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_billauditcount + tmaTB.Rows.Count.ToString(); break; #endregion #region 未刷補卡 case "KQMMakeup": //未刷補卡 Status = ""; condition = ""; condition += "and a.BillNo ='" + BillNo + "'"; if (!this.HiddenSFlag.Value.Equals("Y")) { condition += " and a.Status='1' "; } // Bll_AbnormalAttendanceHandle bll_signabnormal = new Bll_AbnormalAttendanceHandle(); // OTMActivityApplyBll KQMMakeupBll = new OTMActivityApplyBll(); WorkFlowCardMakeupBll cardMakeupBll = new WorkFlowCardMakeupBll(); int totalCount = 0; DataTable tmaKQMMakeupTB = cardMakeupBll.getCardMakeupList(condition, 1, Int32.MaxValue, out totalCount); // DataTable tmaKQMMakeupTB = new DataTable();// bll_signabnormal.GetSignAbnormalAttendanceInfo(BillNo, Status); UltraWebGridKQU.DataSource = tmaKQMMakeupTB; UltraWebGridKQU.DataBind(); UltraWebGridKQU.Visible = true; this.labelMessage.Text = Message.wfm_inworknum + inWorkNum + ";" + Message.wfm_leavenum + LeaveNum + ";" + Message.wfm_billauditcount + tmaKQMMakeupTB.Rows.Count.ToString(); break; #endregion default: break; } }
protected void Page_Load(object sender, EventArgs e) { JavaScriptSerializer JsSerializer = new JavaScriptSerializer(); Dictionary<string, string> ClientMessage = null; SetCalendar(txtEvectionTime); txtApproveDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); HiddenModuleCode.Value = Request.QueryString["ModuleCode"].ToString(); if (!IsPostBack) { this.txtDepName.Text = CurrentUserInfo.DepName; this.txtDepCode.Text = CurrentUserInfo.DepCode; this.txtWorkNo.Text = CurrentUserInfo.Personcode; this.txtLocalName.Text = CurrentUserInfo.Cname; logmodel.ProcessOwner = CurrentUserInfo.Personcode; logmodel.TransactionType = Request.QueryString["ModuleCode"]; logmodel.LevelNo = "2"; logmodel.FromHost = Request.UserHostAddress; this.DropDownListBind(this.ddlEvectionType, "EvectionTypeOut"); this.DropDownListBind(this.ddlStatus, "BillAuditState"); model = PageHelper.GetModel<KQMEvectionApplyModel>(pnlContent.Controls); DataUIBind(); } if (ClientMessage == null) { ClientMessage = new Dictionary<string, string>(); ClientMessage.Add("AtLastOneChoose", Message.AtLastOneChoose); ClientMessage.Add("DeleteFailed", Message.DeleteFailed); ClientMessage.Add("DeleteSuccess", Message.DeleteSuccess); ClientMessage.Add("TextBoxNotNull", Message.TextBoxNotNull); ClientMessage.Add("DeleteConfirm", Message.DeleteConfirm); ClientMessage.Add("btnImport", Message.btnImport); ClientMessage.Add("btnBack", Message.btnBack); ClientMessage.Add("UnAudit", Message.UnAudit); ClientMessage.Add("UnSendAudit", Message.UnSendAudit); ClientMessage.Add("NoSelect", Message.NoSelect); ClientMessage.Add("ConfirmReturn", Message.ConfirmReturn); ClientMessage.Add("UnCancelAudit", Message.UnCancelAudit); ClientMessage.Add("OnlyNoAudit", Message.OnlyNoAudit); ClientMessage.Add("OnlyNoCanModify", Message.OnlyNoCanModify); ClientMessage.Add("ErrReturnTimeWrong", Message.ErrReturnTimeWrong); ClientMessage.Add("WrongDate", Message.WrongDate); } string clientmsg = JsSerializer.Serialize(ClientMessage); Page.ClientScript.RegisterStartupScript(GetType(), "ClientMessage", "var Message=" + clientmsg + ";", true); PageHelper.ButtonControlsWF(FuncList, pnlShowPanel.Controls, base.FuncListModule); }
protected void pager_PageChanged(object sender, EventArgs e) { model = PageHelper.GetModel<KQMEvectionApplyModel>(pnlContent.Controls); DataUIBind(); }
protected void btnSave_Click(object sender, EventArgs e) { if (this.UltraWebGridEvectionApply.Rows.Count != 0) { int i; TemplatedColumn tcol = (TemplatedColumn)this.UltraWebGridEvectionApply.Bands[0].Columns[0]; for (i = 0; i < this.UltraWebGridEvectionApply.Rows.Count; i++) { if (((tcol.CellItems[i] as CellItem).FindControl("CheckBoxCell") as CheckBox).Checked) { string ID = this.UltraWebGridEvectionApply.Rows[i].Cells.FromKey("ID").Text.Trim(); string Status = "2"; model.ApproveDate = Convert.ToDateTime(txtApproveDate.Text.ToString()); model.Approver = txtApprover.Text.ToString(); int flag = bll.UpdateEvction(ID, Status, model, logmodel); } } model = new KQMEvectionApplyModel(); DataUIBind(); this.ProcessFlag.Value = ""; } }
protected void btnQuery_Click(object sender, EventArgs e) { model = PageHelper.GetModel<KQMEvectionApplyModel>(pnlContent.Controls); pager.CurrentPageIndex = 1; DataUIBind(); hidOperate.Value = ""; }
protected void btnCancelAudit_Click(object sender, EventArgs e) { if (this.UltraWebGridEvectionApply.Rows.Count != 0) { int i; int intDeleteOk = 0; int intDeleteError = 0; CellItem GridItem; CheckBox chkIsHaveRight; TemplatedColumn tcol = (TemplatedColumn)this.UltraWebGridEvectionApply.Bands[0].Columns[0]; for (i = 0; i < this.UltraWebGridEvectionApply.Rows.Count; i++) { GridItem = (CellItem)tcol.CellItems[i]; chkIsHaveRight = (CheckBox)GridItem.FindControl("CheckBoxCell"); if (chkIsHaveRight.Checked) { string ID = this.UltraWebGridEvectionApply.Rows[i].Cells.FromKey("ID").Text.Trim(); string Status = "0"; int flag = bll.UpdateEvction(ID, Status, logmodel); if (flag == 1) { intDeleteOk++; } else { intDeleteError++; } } } if ((intDeleteOk + intDeleteError) > 0) { string alertText = Message.CancelAuditSucccess + ":" + intDeleteOk + "," + Message.CancelAuditFaile + ":" + intDeleteError; Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + alertText + "')", true); } model = new KQMEvectionApplyModel(); DataUIBind(); this.ProcessFlag.Value = ""; } }
protected void btnSave_Click(object sender, EventArgs e) { if (this.UltraWebGridEvectionApply.Rows.Count != 0) { int i; int intDeleteOk = 0; int intDeleteError = 0; TemplatedColumn tcol = (TemplatedColumn)this.UltraWebGridEvectionApply.Bands[0].Columns[0]; for (i = 0; i < this.UltraWebGridEvectionApply.Rows.Count; i++) { if (((tcol.CellItems[i] as CellItem).FindControl("CheckBoxCell") as CheckBox).Checked) { string ID = this.UltraWebGridEvectionApply.Rows[i].Cells.FromKey("ID").Text.Trim(); string Status = "2"; model.ApproveDate = Convert.ToDateTime(txtApproveDate.Text.ToString()); model.Approver = txtApprover.Text.ToString(); int flag = bll.UpdateEvction(ID, Status, model, logmodel); if (flag == 1) { intDeleteOk++; } else { intDeleteError++; } } } if ((intDeleteOk + intDeleteError) > 0) { string alertText = Message.AuditSucccess + ":" + intDeleteOk + "," + Message.AuditSucccess + ":" + intDeleteError; Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + alertText + "')", true); } model = new KQMEvectionApplyModel(); DataUIBind(); this.ProcessFlag.Value = ""; } }