예제 #1
0
        protected void btnLoadFile_Click(object sender, EventArgs e)
        {
            ClearAndDisbleImport();
            pnlImportFile.Visible = false;

            if (string.IsNullOrEmpty(FuFile.FileName))
            {
                UCModalError.ShowMessageError = SysMessage.PleaseSelectFileData;
                UCModalError.ShowModalError();
                return;
            }
            if (String.IsNullOrEmpty(ddlBankTranfer.SelectedValue))
            {
                UCModalError.ShowMessageError = SysMessage.PleaseSelectBankData;
                UCModalError.ShowModalError();
                return;
            }
            else
            {
                var biz = new BLL.PaymentBiz();
                var res = biz.UploadData(FuFile.FileName, FuFile.PostedFile.InputStream, base.UserId, ddlBankTranfer.SelectedValue);
                if (res.IsError)
                {
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else if (res.DataResponse != null && res.DataResponse.Header != null &&
                         !String.IsNullOrEmpty(res.DataResponse.Header.FirstOrDefault().ErrMessage))
                {
                    UCModalError.ShowMessageError = res.DataResponse.Header.FirstOrDefault().ErrMessage;
                    UCModalError.ShowModalError();
                }
                else
                {
                    Session["GroupID"] = res.DataResponse.GroupId;
                    if (res.DataResponse.Header.Count > 0)
                    {
                        Session["gvImportFileSource"] = res.DataResponse.Header;
                        Session["gvCheckListSource"]  = res.DataResponse.Detail;

                        //***********   ***********************
                        IsEnableChangePanel(true);

                        BindValidateGridAll();



                        //****************************************


                        hdfGroupID.Value = res.DataResponse.GroupId;


                        if ((GvCheckListSource != null && GvCheckListSource.Count() >= 0) &&
                            (GvPaymentMissingSource != null && GvPaymentMissingSource.Count() == 0) &&
                            (GvPaymentLateSource != null && GvPaymentLateSource.Count() == 0) &&
                            (GvPaymentInvalidSource != null && GvPaymentInvalidSource.Count() == 0)
                            )
                        {
                            bntConfirmChange_Click(bntConfirmChange, e);
                        }
                    }
                }
            }
        }