public void SetData(string sSpTypeID, string sCustomerType, string sMasterNo)
        {
            CustomerTypeWiseSPLimit    oCTWiseSPLimit    = new CustomerTypeWiseSPLimit(sCustomerType, sSpTypeID);
            CustomerTypeWiseSPLimitDAL oCTWiseSPLimitDAL = new CustomerTypeWiseSPLimitDAL();
            Result oResult = new Result();

            oResult = oCTWiseSPLimitDAL.LoadByID(oCTWiseSPLimit);
            if (oResult.Status)
            {
                oCTWiseSPLimit       = (CustomerTypeWiseSPLimit)oResult.Return;
                txtSPType.Text       = sSpTypeID;
                txtCustomerType.Text = sCustomerType;
                txtMaximumLimit.Text = oCTWiseSPLimit.MinimumLimit.ToString();
                txtMinimumLimit.Text = oCTWiseSPLimit.MaximumLimit.ToString();
            }

            // Load Grid Data
            oResult = oCTWiseSPLimitDAL.CheckUserLimit(sSpTypeID, sMasterNo);
            if (oResult.Status)
            {
                DataTable dtLimit = (DataTable)oResult.Return;
                if (dtLimit != null)
                {
                    if (dtLimit.Rows.Count > 0)
                    {
                        dtLimit.Rows[0]["Allowed Limit"] = (Util.GetDecimalNumber(dtLimit.Rows[0]["IssueAmount"].ToString()) - Util.GetDecimalNumber(txtMaximumLimit.Text)).ToString();
                    }
                }
                gvSearchList.DataSource = dtLimit;
                gvSearchList.DataBind();
                decimal tfsHours = (decimal)dtLimit.Compute("Sum(IssueAmount)", "");
                txtTotalAmount.Text = tfsHours.ToString("N2");
            }
        }
Пример #2
0
    private void LoadDataByID(string sCustomerID, string sSPTypeID)
    {
        CustomerTypeWiseSPLimit    oCTWiseSPLimit    = new CustomerTypeWiseSPLimit(sCustomerID, sSPTypeID);
        CustomerTypeWiseSPLimitDAL oCTWiseSPLimitDAL = new CustomerTypeWiseSPLimitDAL();

        Result oResult = new Result();

        oResult = oCTWiseSPLimitDAL.LoadByID(oCTWiseSPLimit);
        if (oResult.Status)
        {
            oCTWiseSPLimit = (CustomerTypeWiseSPLimit)oResult.Return;
            DDListUtil.Assign(ddlSPType, oCTWiseSPLimit.SPType.SPTypeID.Trim());
            DDListUtil.Assign(ddlCustType, oCTWiseSPLimit.CustomerType.CustomerTypeID.Trim());
            ddlCustType.Enabled = false;
            ddlSPType.Enabled   = false;
            txtMinLim.Text      = oCTWiseSPLimit.MinimumLimit.ToString();
            txtMaxLim.Text      = oCTWiseSPLimit.MaximumLimit.ToString();
            if (string.IsNullOrEmpty(hdDataType.Value))
            {
                //When Loading from Approver End
                UserDetails userDetails = ucUserDet.UserDetail;
                userDetails.MakerID  = oCTWiseSPLimit.UserDetails.MakerID;
                userDetails.MakeDate = oCTWiseSPLimit.UserDetails.MakeDate;
                ucUserDet.UserDetail = userDetails;
            }
            else if (hdDataType.Value.Equals("T"))
            {
                //When loading from temp table
                UserDetails userDetails = ucUserDet.UserDetail;
                userDetails.CheckDate      = oCTWiseSPLimit.UserDetails.CheckDate;
                userDetails.CheckerID      = oCTWiseSPLimit.UserDetails.CheckerID;
                userDetails.CheckDate      = oCTWiseSPLimit.UserDetails.CheckDate;
                userDetails.CheckerComment = oCTWiseSPLimit.UserDetails.CheckerComment;
                ucUserDet.UserDetail       = userDetails;
            }

            hdCustomerID.Value = oCTWiseSPLimit.CustomerType.CustomerTypeID;
            hdSPTypeID.Value   = oCTWiseSPLimit.SPType.SPTypeID;
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
        }
    }