Example #1
0
        private void confirm()
        {
            DataSet resultDs;
            int     lot = 0;

            int.TryParse(Request["lot"], out lot);
            SlmScr032Biz biz = new SlmScr032Biz();

            List <SlmScr032SearchResult> successList = biz.GetSuccessList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, cmbTelesalesTeam.SelectedValue, cmbOwnerSearch.SelectedValue, out resultDs);

            List <SlmScr032SearchResult> dedupList = biz.GetDedubList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);

            List <SlmScr032SearchResult> blacklistList = biz.GetBlackListList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);

            List <SlmScr032SearchResult> exceptionalList = biz.GetExceptionalList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);


            if (biz.UpdateDelegateList(lot, successList, dedupList, blacklistList, exceptionalList, HttpContext.Current.User.Identity.Name.ToLower()))
            {
                AppUtil.ClientAlertAndRedirect(this, "Confirm ข้อมูลการจ่ายงานแล้ว", ResolveUrl("~/SLM_SCR_047.aspx"));
            }
            else
            {
                AppUtil.ClientAlert(this, biz.ErrorMessage);
            }
        }
Example #2
0
        protected void pcBlacklist_PageChange(object sender, EventArgs e)
        {
            try
            {
                //sender = null มาจากการกดปุ่ม Search, PageLoad
                if (sender != null)
                {
                    SaveCheckedBlacklist();
                }

                DataSet resultDs;
                int     lot = 0;
                int.TryParse(Request["lot"], out lot);
                SlmScr032Biz biz             = new SlmScr032Biz();
                var          blackListResult = biz.GetBlackListList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);
                BindGridview(pcBlacklist, gvBlacklist, blackListResult.ToArray(), pcBlacklist.SelectedPageIndex);
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Example #3
0
        protected void btnExportExcel_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet resultDs;
                int     lot = 0;
                int.TryParse(Request["lot"], out lot);
                SlmScr032Biz biz            = new SlmScr032Biz();
                string       date           = DateTime.Now.Year.ToString() + DateTime.Now.ToString("MMddHHmmss");
                string       filename       = "";
                string       outputFilename = "";
                bool         doExport       = false;

                switch (tabMain.ActiveTabIndex)
                {
                case 0:     // tab success
                    var successList = biz.GetSuccessList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, cmbTelesalesTeam.SelectedValue, cmbOwnerSearch.SelectedValue, out resultDs);
                    //if (resultDs.Tables[0].Rows.Count > 0)
                    if (successList.Count > 0)
                    {
                        filename = Path.Combine(Path.GetTempPath(), Page.User.Identity.Name + "_" + date + ".xls");
                        biz.CreateExcel(successList, filename, "success", "jobDelegateSuccessTab");
                        outputFilename = "jobDelegateSuccessTab.xls";
                        doExport       = true;
                    }
                    break;

                case 1:     // tab dedup
                    var dedubList = biz.GetDedubList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);
                    if (dedubList.Count > 0)
                    {
                        filename = Path.Combine(Path.GetTempPath(), Page.User.Identity.Name + "_" + date + ".xls");
                        biz.CreateExcel(dedubList, filename, "dedup", "jobDelegateDedupTab");
                        outputFilename = "jobDelegateDedupTab.xls";
                        doExport       = true;
                    }
                    break;

                case 2:     // tab blacklist
                    var blacklistList = biz.GetBlackListList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);
                    if (blacklistList.Count > 0)
                    {
                        filename = Path.Combine(Path.GetTempPath(), Page.User.Identity.Name + "_" + date + ".xls");
                        biz.CreateExcel(blacklistList, filename, "blacklist", "jobDelegateBlacklistTab");
                        outputFilename = "jobDelegateBlacklistTab.xls";
                        doExport       = true;
                    }
                    break;

                case 3: break;     // not allow to export tab Exceptional

                default: break;
                }

                if (doExport)
                {
                    Session["excelfilepath"]  = filename;
                    Session["outputfilename"] = outputFilename;

                    string script = "window.open('SLM_SCR_045.aspx', 'exporttab', 'status=yes, toolbar=no, scrollbars=no, menubar=no, width=300, height=100, resizable=yes');";
                    ScriptManager.RegisterStartupScript(Page, GetType(), "exporttab", script, true);
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }