コード例 #1
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     RealapplyModel model = new RealapplyModel();
     List<RealapplyModel> list = bll.GetList(dt_global);
     string[] header = { ControlText.gvHeadDepName, ControlText.gvHeadWorkNo, ControlText.gvHeadLocalName, ControlText.gvHeadOTDate, ControlText.gvHeadOverTimeType, ControlText.gvHeadWeek, ControlText.gvHeadOTType, ControlText.gvHeadBeginTime, ControlText.gvHeadEndTime, ControlText.gvHeadAdvanceHours, ControlText.gvHeadWorkDesc, ControlText.gvHeadImportRemark, ControlText.gvHeadStatusName, ControlText.gvHeadBillNo };
     string[] properties = { "DepName", "EmployeeNo", "Name", "OTDate", "OverTimeType", "Week", "OTType", "BeginTime", "EndTime", "AdvanceHours", "WorkDesc", "ImportRemark", "StatusName", "BillNo" };
     string filePath = MapPath("~/ExportFileTemp/") + DateTime.Now.Ticks + ".xls";
     NPOIHelper.ExportExcel(list, header, properties, 5000, filePath);
     PageHelper.ReturnHTTPStream(filePath, true);
 }
コード例 #2
0
 protected void btnCancelAudit_Click(object sender, EventArgs e)
 {
     logmodel.ProcessFlag = "update";
     int intUpdateOk = 0;
     int intUpdateError = 0;
     TemplatedColumn tcol = (TemplatedColumn)this.UltraWebGrid.Bands[0].Columns[0];
     for (int i = 0; i < this.UltraWebGrid.Rows.Count; i++)
     {
         CellItem GridItem = (CellItem)tcol.CellItems[i];
         CheckBox chkIsHaveRight = (CheckBox)GridItem.FindControl("CheckBoxCell");
         if (chkIsHaveRight.Checked)
         {
             RealapplyModel model = new RealapplyModel();
             model.Id = this.UltraWebGrid.Rows[i].Cells.FromKey("ID").Text.Trim();
             model.Status = "0";
             int num = bll.UpdateRealapplyByKey(model,logmodel);
             if (num > 0)
             {
                 intUpdateOk++;
             }
             else
             {
                 intUpdateError++;
             }
         }
     }
     if ((intUpdateOk + intUpdateError) > 0)
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isnumber", "alert('" + Message.UpdateSuccess + ":" + intUpdateOk + ";" + Message.UpdateFailed + ":" + intUpdateError + "');", true);
         DataBind();
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isnumber", "alert('" + Message.AtLastOneChoose + "');", true);
         return;
     }
 }
コード例 #3
0
 /// <summary>
 /// 綁定數據
 /// </summary>
 private void DataBind()
 {
     RealapplyModel model = new RealapplyModel();
     dt_global = bll.GetRealapply(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, ddlHoursCondition.SelectedValue, txtHours.Text.Trim(), txtOTDateFrom.Text.Trim(), txtOTDateTo.Text.Trim(), txtBatchEmployeeNo.Text.Trim(),base.SqlDep);
     pager.RecordCount = totalCount;
     this.UltraWebGrid.DataSource = dt_global;
     this.UltraWebGrid.DataBind();
     pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString();
 }