Exemple #1
0
        private void LoadViewFields()
        {
            bool    isMainPortfolio = false;
            DataSet dsPortfolioType = new DataSet();

            dsPortfolioType = customerTransactionBo.GetPortfolioType(mfTransactionVo.Folio);

            try
            {
                if (dsPortfolioType.Tables[0].Rows.Count > 0)
                {
                    if (Convert.ToInt16(dsPortfolioType.Tables[0].Rows[0][0].ToString()) == 1)
                    {
                        isMainPortfolio = true;
                    }
                }

                if (Session["MFEditValue"].ToString() == "Edit")
                {
                    SetFields(1);
                }
                else
                {
                    SetFields(0);
                }

                //if (mfTransactionVo.IsSourceManual == 1)
                //{
                //    lnkEdit.Visible = true;
                //}
                //else
                //{
                //    lnkEdit.Visible = false;
                //}

                lblAMCName.Text         = mfTransactionVo.AMCName;
                lblcategoryName.Text    = mfTransactionVo.Category;
                lblScheme.Text          = mfTransactionVo.SchemePlan.ToString();
                lblTransactionType.Text = mfTransactionVo.TransactionType.ToString();
                lblTransactionNoV.Text  = mfTransactionVo.userTransactionNo.ToString();
                lblFolioNumber.Text     = mfTransactionVo.Folio.ToString();
                txtTransactionDate.Text = mfTransactionVo.TransactionDate.ToShortDateString().ToString();
                txtSubBrokerCode.Text   = mfTransactionVo.AgentCode.ToString();
                if (mfTransactionVo.TransactionClassificationCode == "DVR" || mfTransactionVo.TransactionClassificationCode == "DVP")
                {
                    trDividendRate.Visible = true;
                    txtDividentRate.Text   = mfTransactionVo.DividendRate.ToString();
                }
                else
                {
                    dvDividentRate.Visible = false;
                    trDividendRate.Visible = false;
                }
                txtAmount.Text = String.Format("{0:n2}", decimal.Parse(mfTransactionVo.Amount.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")));
                //txtAmount.Text = mfTransactionVo.Amount.ToString();
                txtNAV.Text   = mfTransactionVo.NAV.ToString();
                txtPrice.Text = mfTransactionVo.Price.ToString();
                if (mfTransactionVo.BuySell == "S")
                {
                    trSTT.Visible = true;
                    txtSTT.Text   = mfTransactionVo.STT.ToString();
                }
                else
                {
                    dvSTT.Visible = false;
                    trSTT.Visible = false;
                }
                txtUnits.Text = mfTransactionVo.Units.ToString("f4");
                lblTransactionStatusValue.Text = mfTransactionVo.TransactionStatus.ToString();

                ShowHideCommandButton(isMainPortfolio, mfTransactionVo.IsSourceManual == 1 ? true : false, Session[SessionContents.CurrentUserRole].ToString() == "Customer" ? true : false, mfTransactionVo.TransactionStatusCode == 1 ? true : false);


                if (mfTransactionVo.TransactionStatusCode == 2 || mfTransactionVo.TransactionStatusCode == 3)
                {
                    btnCancel.Visible = false;
                }
                else
                {
                    btnCancel.Visible = true;
                }

                //if (Session[SessionContents.CurrentUserRole].ToString() == "Customer")
                //{
                //    btnCancel.Visible = false;
                //    lnkEdit.Visible = false;
                //}
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewMFTransaction.ascx:LoadViewFields()");
                object[] objects = new object[1];
                objects[0]   = mfTransactionVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }