示例#1
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtBBReferenceNo.Text))
            {
                CommissionReimbursement    oComReim         = Session[Constants.SES_COMM_CLAIM_RECON] as CommissionReimbursement;
                CommClaimReconciliationDAL oCommClaimRecDAL = new CommClaimReconciliationDAL();
                //get User Details
                oComReim.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oCommClaimRecDAL.Approve(oComReim);
                if (oResult.Status)
                {
                    TotalClear();
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
            }
        }
示例#2
0
        private void SetObject(CommissionReimbursement oComReim)
        {
            Session[Constants.SES_COMM_CLAIM_RECON] = oComReim;

            if (oComReim != null)
            {
                ddlSpType.Text        = oComReim.SPType.SPTypeID;
                ddlYear.Text          = oComReim.ReimburseDate.Year.ToString();
                txtReconDate.Text     = oComReim.ReimburseDate.ToString(Constants.DATETIME_FORMAT);
                txtBBReferenceNo.Text = oComReim.CommissionReimburseReferenceNo;
                LoadCurrencyBySPType(oComReim.SPType.SPTypeID);
                ddlReconCurrency.Text         = oComReim.Currency.CurrencyID;
                txtRecConvRate.Text           = Convert.ToString(oComReim.ConvRate);
                hdnReconComClaimTransNo.Value = oComReim.CommissionReimburseTransNo;

                //Set user details
                if (SEARCH_FROM.Equals(1))//if viewed from Temp By Maker
                {
                    ucUserDet.UserDetail = oComReim.UserDetails;
                }
                else if (SEARCH_FROM.Equals(2))//if viewed from Temp By Checker
                {
                    UserDetails oUserDetails = ucUserDet.UserDetail;
                    oUserDetails.MakeDate = oComReim.UserDetails.MakeDate;
                    oUserDetails.MakerID  = oComReim.UserDetails.MakerID;
                    ucUserDet.UserDetail  = oUserDetails;
                }

                gvClaim.DataSource = oComReim.DtCommClaimReimbursement;
                gvClaim.DataBind();
                //Set a background color as Selected
                //gvClaim.Rows[0].BackColor = Color.Blue;
                SetClaimSatementDetailSectionValue(oComReim.DtCommClaimReimbursement);

                if (gvClaim.Rows.Count > 0)
                {
                    PopulateSalesStatementDetailsGrid(gvClaim.Rows[0]);
                }
            }
        }
示例#3
0
        protected void gvClaim_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //get the row
            GridViewRow gvRow = (GridViewRow)((Button)e.CommandSource).NamingContainer;

            //gvClaim.RowStyle.CssClass = "odd";
            //gvRow.BackColor = Color.Blue;

            if (((Button)e.CommandSource).Text.Equals("Select"))
            {
                PopulateSalesStatementDetailsGrid(gvRow);
                SetCommReconDetails(gvRow);
                btnAdd.Focus();
            }
            else if (((Button)e.CommandSource).Text.Equals("Remove"))
            {
                CommissionReimbursement oComReim = (CommissionReimbursement)Session[Constants.SES_COMM_CLAIM_RECON];

                if (oComReim != null)
                {
                    oComReim.DtCommClaimReimbursement.Rows.RemoveAt(gvRow.RowIndex);

                    gvClaim.DataSource = oComReim.DtCommClaimReimbursement;
                    gvClaim.DataBind();

                    //Store in Session
                    Session[Constants.SES_COMM_CLAIM_RECON] = oComReim;

                    if (gvRow.Cells[2].Text.Equals(txtReferenceNo.Text.Trim()))
                    {
                        ClearCommClaimSection();
                    }
                    //Set Values
                    SetClaimSatementDetailSectionValue(oComReim.DtCommClaimReimbursement);
                }

                txtReferenceNo.Focus();
            }
        }
示例#4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            CommissionReimbursement oCommReim = (CommissionReimbursement)Session[Constants.SES_COMM_CLAIM_RECON];

            if (oCommReim != null)
            {
                oCommReim.CommissionReimburseTransNo     = hdnReconComClaimTransNo.Value.Equals("") ? "-1" : hdnReconComClaimTransNo.Value;
                oCommReim.CommissionReimburseReferenceNo = txtBBReferenceNo.Text.Trim().ToUpper();
                oCommReim.SPType.SPTypeID        = ddlSpType.SelectedValue;
                oCommReim.ReimburseDate          = Util.GetDateTimeByString(txtReconDate.Text);
                oCommReim.Currency.CurrencyID    = ddlReconCurrency.SelectedValue;
                oCommReim.ConvRate               = Util.GetDecimalNumber(txtRecConvRate.Text);
                oCommReim.OrgCommissionAmount    = Util.GetDecimalNumber(txtOrgComSubTotl.Text);
                oCommReim.NonOrgCommissionAmount = Util.GetDecimalNumber(txtNonOrgComSubTotl.Text);

                oCommReim.UserDetails = ucUserDet.UserDetail;

                CommClaimReconciliationDAL oCommClaimRecDAL = new CommClaimReconciliationDAL();
                Result oResult = oCommClaimRecDAL.Save(oCommReim);
                if (oResult.Status)
                {
                    TotalClear();
                    LoadPreviousList();
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    if (oResult.Message.Equals("A"))
                    {
                        ucMessage.OpenMessage("This BB Reference No. already used. Please check..", Constants.MSG_TYPE_ERROR);
                    }
                    else
                    {
                        ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
                    }
                }
            }
        }
示例#5
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtBBReferenceNo.Text))
            {
                CommissionReimbursement oCommReim = new CommissionReimbursement();
                oCommReim.CommissionReimburseReferenceNo = txtBBReferenceNo.Text;
                CommClaimReconciliationDAL oCommClaimDAL = new CommClaimReconciliationDAL();
                oCommReim.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oCommClaimDAL.Reject(oCommReim);
                if (oResult.Status)
                {
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_REJECT, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
            }
        }
示例#6
0
        protected void txtReferenceNo_TextChanged(object sender, EventArgs e)
        {
            bool   isRefNoFrmtOk = false;
            string sRefNo        = txtReferenceNo.Text.Trim();

            //string[] aRefNo = sRefNo.Split('/');
            //if (aRefNo.Length.Equals(4))
            //{
            //    isRefNoFrmtOk = true;
            //}
            if (!string.IsNullOrEmpty(ddlSpType.SelectedValue) && !string.IsNullOrEmpty(ddlYear.SelectedValue))
            {
                sRefNo = ddlSpType.SelectedValue + "/ABC/" + sRefNo + "/" + ddlYear.SelectedValue;
                txtReferenceNo.Text = sRefNo;
                isRefNoFrmtOk       = true;
            }
            if (isRefNoFrmtOk)
            {
                int iIndx = -1;
                CommissionReimbursement oCommReim = (CommissionReimbursement)Session[Constants.SES_COMM_CLAIM_RECON];
                if (oCommReim != null)
                {
                    DataTable dtClaimDetails = oCommReim.DtCommClaimReimbursement;
                    //For Each dr As DataRow In dt.Select("query")
                    DataRow[] rows = dtClaimDetails.Select("RefNo='" + txtReferenceNo.Text + "'");
                    foreach (var vClaimDtl in rows)
                    {
                        iIndx = dtClaimDetails.Rows.IndexOf(vClaimDtl);
                        if ((gvClaim.Rows.Count > iIndx))
                        {
                            GridViewRow gvRow = gvClaim.Rows[iIndx];
                            SetCommReconDetails(gvRow);
                        }
                        break;
                    }
                }
                if (iIndx.Equals(-1))
                {
                    CommClaimReconciliationDAL oComRecDAL = new CommClaimReconciliationDAL();
                    Result oResult = oComRecDAL.GetCommClaimDataByRefNo(txtReferenceNo.Text, ucUserDet.UserDetail.Division);

                    if (oResult.Status)
                    {
                        DataTable dtCommClaim = oResult.Return as DataTable;
                        if (dtCommClaim.Columns.Count.Equals(1))
                        {
                            ucMessage.OpenMessage("This reference number already reconciled !!", Constants.MSG_TYPE_INFO);
                            ScriptManager.RegisterStartupScript(this.UpdatePanel5, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                            ClearCommClaimSection();
                        }
                        else if (dtCommClaim.Rows.Count > 0)
                        {
                            //DDListUtil.Assign(ddlSpType, DB.GetDBValue(dtCommClaim.Rows[0]["SPTypeID"]));
                            txtClaimBBDate.Text      = (Date.GetDateTimeByString(dtCommClaim.Rows[0]["StatementDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimFromDate.Text    = (Date.GetDateTimeByString(dtCommClaim.Rows[0]["FromDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimToDate.Text      = (Date.GetDateTimeByString(dtCommClaim.Rows[0]["ToDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimCurrncy.Text     = DB.GetDBValue(dtCommClaim.Rows[0]["CurrencyCode"]);
                            txtClaimConvRate.Text    = DB.GetDBDecimalValue(dtCommClaim.Rows[0]["ConvRate"]).ToString();
                            txtOrgCommssn.Text       = DB.GetDBDecimalValue(dtCommClaim.Rows[0]["TotalOrgCommission"]).ToString();
                            txtNonOrgCommssn.Text    = DB.GetDBDecimalValue(dtCommClaim.Rows[0]["TotalNonOrgCommission"]).ToString();
                            txtRecOrgCommssn.Text    = DB.GetDBDecimalValue(dtCommClaim.Rows[0]["TotalOrgCommission"]).ToString();
                            txtRecNonOrgCommssn.Text = DB.GetDBDecimalValue(dtCommClaim.Rows[0]["TotalNonOrgCommission"]).ToString();
                            txtClaimComment.Text     = string.Empty;
                            hdnCommClaimTrnsNo.Value = DB.GetDBValue(dtCommClaim.Rows[0]["CommissionClaimTransNo"]);
                        }
                        else
                        {
                            ucMessage.OpenMessage("Invalid reference number!!", Constants.MSG_TYPE_INFO);
                            ScriptManager.RegisterStartupScript(this.UpdatePanel5, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                            ClearCommClaimSection();
                        }
                    }
                }

                btnAdd.Focus();
            }
            else
            {
                ucMessage.OpenMessage("Please select SP Type and Year.", Constants.MSG_TYPE_INFO);
                ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                ClearCommClaimSection();
            }
        }
示例#7
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            CommissionReimbursement oCommReim = (CommissionReimbursement)Session[Constants.SES_COMM_CLAIM_RECON];

            if (oCommReim == null)
            {
                oCommReim = new CommissionReimbursement();
            }

            // SaleStatement List
            DataTable dtClaimDetails = oCommReim.DtCommClaimReimbursement;

            if (dtClaimDetails.Columns.Count <= 0)
            {
                dtClaimDetails.Columns.Add(new DataColumn("RefNo", typeof(string)));
                dtClaimDetails.Columns.Add(new DataColumn("ClaimDateBB", typeof(string)));
                dtClaimDetails.Columns.Add(new DataColumn("ClaimDateFrom", typeof(string)));
                dtClaimDetails.Columns.Add(new DataColumn("ClaimDateTo", typeof(string)));
                dtClaimDetails.Columns.Add(new DataColumn("TotlOrgComm", typeof(decimal)));
                dtClaimDetails.Columns.Add(new DataColumn("TotlNonOrgComm", typeof(decimal)));
                dtClaimDetails.Columns.Add(new DataColumn("RecOrgComm", typeof(decimal)));
                dtClaimDetails.Columns.Add(new DataColumn("RecNonOrgComm", typeof(decimal)));
                dtClaimDetails.Columns.Add(new DataColumn("Comment", typeof(string)));
                //saving in DB purpose. This is hidden is design
                dtClaimDetails.Columns.Add(new DataColumn("CommClaimTransNo", typeof(string)));
            }
            DataRow[] rows = dtClaimDetails.Select("RefNo='" + txtReferenceNo.Text + "'");

            if (rows.Length <= 0)
            {
                DataRow rowClaimDetails = dtClaimDetails.NewRow();
                rowClaimDetails["RefNo"] = txtReferenceNo.Text.ToUpper();
                DateTime parsedDate;
                DateTime.TryParseExact(txtClaimBBDate.Text, Constants.DateTimeFormats, null, DateTimeStyles.None, out parsedDate);
                //parsedDate = Convert.ToDateTime(txtClaimBBDate.Text);
                rowClaimDetails["ClaimDateBB"] = parsedDate.ToString(Constants.DATETIME_dd_MMM_yyyy);//txtClaimBBDate.Text;
                DateTime.TryParseExact(txtClaimFromDate.Text, Constants.DateTimeFormats, null, DateTimeStyles.None, out parsedDate);
                //parsedDate = Convert.ToDateTime(txtClaimFromDate.Text);
                rowClaimDetails["ClaimDateFrom"] = parsedDate.ToString(Constants.DATETIME_dd_MMM_yyyy);//txtClaimFromDate.Text;
                DateTime.TryParseExact(txtClaimToDate.Text, Constants.DateTimeFormats, null, DateTimeStyles.None, out parsedDate);
                //parsedDate = Convert.ToDateTime(txtClaimToDate.Text);
                rowClaimDetails["ClaimDateTo"]      = parsedDate.ToString(Constants.DATETIME_dd_MMM_yyyy);//txtClaimToDate.Text;
                rowClaimDetails["TotlOrgComm"]      = txtOrgCommssn.Text;
                rowClaimDetails["TotlNonOrgComm"]   = txtNonOrgCommssn.Text;
                rowClaimDetails["RecOrgComm"]       = txtRecOrgCommssn.Text;
                rowClaimDetails["RecNonOrgComm"]    = txtRecNonOrgCommssn.Text;
                rowClaimDetails["Comment"]          = txtClaimComment.Text.ToUpper();
                rowClaimDetails["CommClaimTransNo"] = hdnCommClaimTrnsNo.Value;

                dtClaimDetails.Rows.Add(rowClaimDetails);
            }
            else
            {
                int iRowIndex = -1;
                foreach (var vClaimDtl in rows)
                {
                    iRowIndex = dtClaimDetails.Rows.IndexOf(vClaimDtl);
                    break;
                }

                if (iRowIndex != -1)
                {
                    dtClaimDetails.Rows[iRowIndex]["RecOrgComm"]    = txtRecOrgCommssn.Text;
                    dtClaimDetails.Rows[iRowIndex]["RecNonOrgComm"] = txtRecNonOrgCommssn.Text;
                    dtClaimDetails.Rows[iRowIndex]["Comment"]       = txtClaimComment.Text.ToUpper();
                }
            }

            //Store in Session
            oCommReim.DtCommClaimReimbursement      = dtClaimDetails;
            Session[Constants.SES_COMM_CLAIM_RECON] = oCommReim;

            gvClaim.DataSource = dtClaimDetails;
            gvClaim.DataBind();

            //Set Values
            SetClaimSatementDetailSectionValue(dtClaimDetails);
            ClearCommClaimSection();
            txtReferenceNo.Focus();
        }