Ejemplo n.º 1
0
 /// <summary>
 /// 刪除按鈕事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     logmodel.ProcessFlag = "delete";
     string alert = "";
     model = new AttKQParamsEmpModel();
     model.WorkNo = this.UltraWebGrid.Rows[this.UltraWebGrid.DisplayLayout.SelectedRows[0].Index].Cells[0].Text.Trim();
     if (paramsEmpBll.DeleteKQMParamsEmpData(model, logmodel) > 0)
     {
         alert = "alert('" + Message.DeleteSuccess + "')";
     }
     else
     {
         alert = "alert('" + Message.DeleteFailed + "')";
     }
     ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "show", alert, true);
     model = new AttKQParamsEmpModel();
     this.Query();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 輸出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnExport_Click(object sender, EventArgs e)
        {
            if (!this.PanelImport.Visible)
            {
                if (this.UltraWebGrid.Rows.Count == 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.NoDataExport + "')", true);
                }
                else
                {
                    model = new AttKQParamsEmpModel();
                    model.OrgCode = this.HiddenOrgCode.Value;
                    model.WorkNo = this.txtWorkNo.Text.ToString().Trim();
                    model.LocalName = this.txtLocalName.Text.ToString().Trim();
                    List<AttKQParamsEmpModel> list = paramsEmpBll.GetParamsEmpList(model, base.SqlDep.ToString());
                    string[] header = { ControlText.gvHeadParamsWorkNo, ControlText.gvHeadParamsLocalName, ControlText.gvHeadParamsBellNo, ControlText.gvHeadParamsIsNotKaoQin };
                    string[] properties = { "WorkNo", "LocalName", "BellNo", "IsNotKaoQin" };
                    string filePath = MapPath("~/ExportFileTemp/") + DateTime.Now.Ticks + ".xls";
                    NPOIHelper.ExportExcel(list, header, properties, 5000, filePath);
                    PageHelper.ReturnHTTPStream(filePath, true);
                }
            }
            else
            {
                if (this.UltraWebGridImport.Rows.Count == 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.NoDataExport + "')", true);
                }
                else
                {
                    List<AttKQParamsEmpTempModel> list = paramsEmpTempBll.GetList(dt_global);
                    string[] header = { ControlText.gvHeadParamsErrorMsg, ControlText.gvHeadParamsWorkNo, ControlText.gvHeadParamsLocalName, ControlText.gvHeadParamsBellNo, ControlText.gvHeadParamsIsNotKaoQin };
                    string[] properties = { "ErrorMsg", "WorkNo", "LocalName", "BellNo", "IsNotKaoQin" };
                    string filePath = MapPath("~/ExportFileTemp/") + DateTime.Now.Ticks + ".xls";
                    NPOIHelper.ExportExcel(list, header, properties, 5000, filePath);
                    PageHelper.ReturnHTTPStream(filePath, true);
                }

            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 查詢
 /// </summary>
 /// <param name="WindowOpen"></param>
 /// <param name="forwarderType"></param>
 private void Query()
 {
     string sqlDep = base.SqlDep;
     model = new AttKQParamsEmpModel();
     model.OrgCode = this.HiddenOrgCode.Value;
     model.WorkNo = this.txtWorkNo.Text.ToString().Trim();
     model.LocalName = this.txtLocalName.Text.ToString().Trim();
     int totalCount = 0;
     paramsEmp = paramsEmpBll.GetParamsEmpList(model, sqlDep, pager.CurrentPageIndex, pager.PageSize, out totalCount);
     pager.RecordCount = totalCount;
     pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString();
     if (paramsEmp != null)
     {
         this.DataUIBind();
     }
 }
        /// <summary>
        /// 查詢
        /// </summary>
        /// <param name="EmployeeNo"></param>
        private void Query(string EmployeeNo)
        {
            empModel = new AttKQParamsEmpModel();
            empModel.WorkNo = this.HiddenEmployeeNo.Value.ToString().Trim();
            empModel.OrgCode = this.HiddenOrgCode.Value;
            tempDataTable = paramsEmpBll.GetKQMParamsEmpData(empModel, base.SqlDep.ToString());
            this.UltraWebGrid.DataSource = tempDataTable.DefaultView;
            this.UltraWebGrid.DataBind();

            if (tempDataTable.Rows.Count > 0)
            {
                if (this.UltraWebGrid.DisplayLayout.SelectedRows.Count == 0)
                {
                    this.UltraWebGrid.Rows[0].Selected = true;
                }
                int intSelect = this.UltraWebGrid.DisplayLayout.SelectedRows[0].Index;
                this.ddlIsNotKaoQin.SelectedValue = (this.UltraWebGrid.Rows[intSelect].Cells[2].Text == null) ? "" : this.UltraWebGrid.Rows[intSelect].Cells[2].Text.Trim();
                string[] temVal = null;
                temVal = (this.UltraWebGrid.Rows[intSelect].Cells[1].Text == null) ? null : this.UltraWebGrid.Rows[intSelect].Cells[1].Text.Split(new char[] { ',' });
                if (temVal != null)
                {
                    for (int iLoop = 0; iLoop < temVal.Length; iLoop++)
                    {
                        for (int j = 0; j < this.ddlBellNo.Items.Count; j++)
                        {
                            if (object.Equals(this.ddlBellNo.Items[j].Value.Trim(), temVal[iLoop].Trim()))
                            {
                                this.ddlBellNo.Items[j].Selected = true;
                            }
                        }
                    }
                }
                this.HiddenIsNotKaoQin.Value = (this.UltraWebGrid.Rows[intSelect].Cells[2].Text == null) ? "" : this.UltraWebGrid.Rows[intSelect].Cells[2].Text.Trim();
                this.HiddenBellNo.Value = (this.UltraWebGrid.Rows[intSelect].Cells[1].Text == null) ? null : this.UltraWebGrid.Rows[intSelect].Cells[1].Text;
                if (this.ddlIsNotKaoQin.SelectedValue == "")
                {
                    this.UltraWebGrid.DataSource = null;
                    this.UltraWebGrid.DataBind();
                }

                this.HiddenEmpNotExist.Value = "";
            }
            else
            {
                this.ddlIsNotKaoQin.SelectedValue = "";
                this.ddlBellNo.ClearSelection();
                this.HiddenEmpNotExist.Value = "no";

            }
        }