public ClientEquityBrokerDetails GetEquityBrokersData(long ID)
 {
     try
     {
         DataSet        data  = new DataSet();
         SqlParameter[] param = new SqlParameter[1];
         param[0] = new SqlParameter("@ID", ID);
         data     = new ADODataFunction().ExecuteDataset(Constants.Procedures.GetEquityBrokerDetailsByID, param, CommandType.StoredProcedure);
         ClientEquityBrokerDetails datas = data.Tables[0].AsEnumerable().Select(a => new ClientEquityBrokerDetails
         {
             ID = a.Field <long>("ID")
             ,
             ClientID = a.Field <long>("ClientID")
             ,
             BrokerID = a.Field <long>("BrokerID")
             ,
             EffectiveFrom = a.Field <string>("EffectiveFrom")
             ,
             EffectiveTo = a.Field <string>("EffectiveTo")
             ,
             BrokerUCC = a.Field <string>("BrokerUCC")
         }).FirstOrDefault();
         return(datas);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 public ClientMainViewModel()
 {
     ClientDetails           = new ClientMain();
     AddressDetails          = new ClientAddresses();
     BankDetails             = new ClientBankDetails();
     DepositryDetails        = new ClientDepositoryDetails();
     EquityBrokerDetails     = new ClientEquityBrokerDetails();
     PersonalDetails         = new ClientPersonal();
     SecondaryContactDetails = new ClientSecondaryContact();
     MappingDetails          = new ClientMapping();
 }
 public int AddUpdateClientEquityBrokerDetails(ClientEquityBrokerDetails model)
 {
     try
     {
         SqlParameter[] param = new SqlParameter[7];
         param[0] = new SqlParameter("@ID", model.ID);
         param[1] = new SqlParameter("@ClientID", model.ClientID);
         param[2] = new SqlParameter("@BrokerID", model.BrokerID);
         param[3] = new SqlParameter("@BrokerUCC", model.BrokerUCC);
         param[4] = new SqlParameter("@EffectiveFrom", model.EffectiveFrom);
         param[5] = new SqlParameter("@EffectiveTo", model.EffectiveTo);
         param[6] = new SqlParameter("@UserID", GetUserID());
         //param[6] = new SqlParameter("@UserID", Convert.ToInt32(GetUserID("RoleID")));
         int i = new ADODataFunction().ExecuteNonQuery(Constants.Procedures.AddUpdateClientEquityBrokerDetails, param, CommandType.StoredProcedure);
         return(i);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }