public void CreateReportDocument(SBM_BLC1.Entity.Claim.CommissionClaim oCommClaim)
        {
            ClaimReportDAL oCRDAL        = new ClaimReportDAL();
            bool           isCoverLetter = false;

            foreach (ListItem item in chkListForBB.Items)
            {
                if (item.Selected)
                {
                    if (item.Value.Equals("With Cover Letter"))
                    {
                        isCoverLetter = true;
                    }
                    else
                    {
                    }
                }
            }

            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

            if (oConfig != null)
            {
                Session["ExportType"] = ddlExportType.SelectedValue;
                Result oResult = oCRDAL.CommissionClaimReportDocument(oCommClaim, GetDataTable(), "", isCoverLetter, oConfig.BranchID);
                if (oResult.Status)
                {
                    Session[Constants.SES_RPT_DATA] = oResult.Return;
                    Page.RegisterStartupScript(Constants.REPORT_WINDOW, Util.OpenReport());
                }
            }
        }
        public bool SaveAndPreviewAction()
        {
            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

            if (oConfig != null)
            {
                if (!txtStatementDate.Text.Equals(DateTime.Now.ToString(Constants.DATETIME_FORMAT)))
                {
                    ucMessage.OpenMessage("Statement Date cannot be greater than or less than todays date.", Constants.MSG_TYPE_INFO);
                    ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                }
                if (txtReferenceNo.Text.Equals(string.Empty))
                {
                    if (!IsValidateData())
                    {
                        return(false);
                    }
                }


                if (txtReferenceNo.Text.Equals(string.Empty))
                {
                    CalculateCommissionClaim();

                    #region     01.  GetObject    ... Get Value

                    SBM_BLC1.Entity.Claim.CommissionClaim oCommClaim = GetObject();
                    DataTable dtCommClaim = GetDataTable();

                    #endregion

                    #region     02. Call and varify..
                    CommissionClaimDAL commClaimDAL = new CommissionClaimDAL();
                    Result             oResult      = commClaimDAL.InsertData(oCommClaim, dtCommClaim);
                    if (oResult.Status)
                    {
                        txtReferenceNo.Text = Convert.ToString(oResult.Return);
                        //ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
                    }
                    else
                    {
                        ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
                        return(false);
                    }
                    #endregion

                    #region     03. for preview
                    Preview(oCommClaim);
                    #endregion
                }

                return(true);
            }

            return(false);
        }
 private void Preview(SBM_BLC1.Entity.Claim.CommissionClaim oCommClaim)
 {
     if (IsValidateData())
     {
         //set required data
         oCommClaim.CommissionClaimReferenceNo = txtReferenceNo.Text;
         if (!string.IsNullOrEmpty(ddlConversionCurrency.SelectedItem.Text))
         {
             string[] CurrencyDesc = ddlConversionCurrency.SelectedItem.Text.Split(':');
             oCommClaim.Currency.CurrencyDesc = CurrencyDesc[1];
         }
         if (!string.IsNullOrEmpty(ddlSpType.SelectedItem.Text))
         {
             string[] TypeDesc = ddlSpType.SelectedItem.Text.Split(':');
             oCommClaim.SPType.TypeDesc = TypeDesc[1];
         }
         CreateReportDocument(oCommClaim);
         //LoadDurationData();
     }
 }
        private SBM_BLC1.Entity.Claim.CommissionClaim GetObject()
        {
            SBM_BLC1.Entity.Claim.CommissionClaim oCommClaim = new SBM_BLC1.Entity.Claim.CommissionClaim();
            oCommClaim.SPType.SPTypeID       = ddlSpType.SelectedValue;
            oCommClaim.StatementDate         = Util.GetDateTimeByString(txtStatementDate.Text);
            oCommClaim.DurationType          = Util.GetIntNumber(ddlDuration.SelectedValue);
            oCommClaim.FromDate              = Util.GetDateTimeByString(txtDateFrom.Text);
            oCommClaim.ToDate                = Util.GetDateTimeByString(ddlDateTo.SelectedValue);
            oCommClaim.Currency.CurrencyID   = ddlConversionCurrency.SelectedValue;
            oCommClaim.ConvRate              = Util.GetDoubleNumber(txtConversionRate.Text);
            oCommClaim.TotalFaceValue        = Util.GetDoubleNumber(txtTotalFaceValue.Text);
            oCommClaim.TotalNonOrgCommission = Util.GetDoubleNumber(txtTotalNonOrgCommission1.Text);
            oCommClaim.TotalOrgCommission    = Util.GetDoubleNumber(txtTotalOrgCommission1.Text);

            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

            oCommClaim.UserDetails.MakerID  = oConfig.UserName;
            oCommClaim.UserDetails.Division = oConfig.DivisionID;
            oCommClaim.UserDetails.BankID   = oConfig.BankCodeID;

            return(oCommClaim);
        }
 protected void btnPreview_Click(object sender, EventArgs e)
 {
     CalculateCommissionClaim();
     SBM_BLC1.Entity.Claim.CommissionClaim oCommClaim = GetObject();
     Preview(oCommClaim);
 }