コード例 #1
0
 /// <summary>
 /// To search Portfolio Manager details by different conditions
 /// </summary>
 /// <param name="DvPortFolio"></param>
 /// <param name="Column"></param>
 /// <param name="Operator"></param>
 /// <param name="Value"></param>
 public void filterDataview(DataView DvPortFolio, string Column, string Operator, string Value)
 {
     DvPortFolio.RowFilter = Column + " " + Operator + "'" + Value + "'";
     if (DvPortFolio.ToTable().Rows.Count == 0)
     {
         MsgPortMana.Msg = "Record(s) not found";
         MsgPortMana.showmsg();
         ViewState["DtPortMana"] = DvPortFolio.ToTable();
         BindPortMana(DvPortFolio.ToTable());
         ddlCol.SelectedIndex = 0;
         ddlOpe.SelectedIndex = 0;
         ddlVal.SelectedIndex = 0;
     }
     else
     {
         ViewState["DtPortMana"] = DvPortFolio.ToTable();
         BindPortMana(DvPortFolio.ToTable());
     }
 }
コード例 #2
0
    /// <summary>
    /// To save and update Portfolio Manager details
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        PortfolioManagerBAL PortManaBAL = new PortfolioManagerBAL();
        int    UserID   = Convert.ToInt32(ddlPortManaUser.SelectedValue.ToString());
        string Status   = ddlPortManaStatus.SelectedValue.ToString();
        bool   IsActive = true;

        if (Status == "Active")
        {
            IsActive = true;
        }
        else if (Status == "InActive")
        {
            IsActive = false;
        }
        if (btnSave.Text == "Save")
        {
            try
            {
                int Result = PortManaBAL.InsertPortfolioManager(UserID, IsActive, LoginUser, Ret);
                DtPortMana = PortManaDetails();
                ViewState["DtPortMana"] = DtPortMana;
                BindPortMana(DtPortMana);
                MsgPortMana.Msg = "Record added successfully";
                MsgPortMana.showmsg();
            }
            catch (Exception ee)
            {
                if (ee.Message == "Duplicate Entry")
                {
                    MsgPortMana.Msg = "Duplicate Entry!";
                    MsgPortMana.showmsg();
                    ClearPortMana();
                }
            }
            finally
            {
                PortManaBAL = null;
            }
        }
    }