/// <summary> /// Create Single Adviser /// </summary> /// <param name="advisorVo"></param> /// <returns>advisorId</returns> public int CreateAdvisor(AdvisorVo advisorVo) { int advisorId; AdvisorDao advisorDao = new AdvisorDao(); try { advisorId = advisorDao.CreateAdvisor(advisorVo); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:CreateAdvisor()"); object[] objects = new object[1]; objects[0] = advisorVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(advisorId); }
public void UpdateCompleteAdviser(UserVo userVo, AdvisorVo adviserVo, RMVo rmVo) { AdvisorDao advisorDao = new AdvisorDao(); try { advisorDao.UpdateCompleteAdviser(userVo, adviserVo, rmVo); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:CreateCompleteAdviser()"); object[] objects = new object[3]; objects[0] = adviserVo; objects[1] = rmVo; objects[2] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
public DataSet GetXMLAdvisorCategory() { DataSet dsGetXMLAdvisorCategory; AdvisorDao advisorDao = new AdvisorDao(); try { dsGetXMLAdvisorCategory = advisorDao.GetXMLAdvisorCategory(); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserSubscriptionDetails(int adviserId)"); object[] objects = new object[1]; objects[0] = "GetXMLAdvisorCategory"; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dsGetXMLAdvisorCategory); }
//public string GetBusinessCode(string businessType,string path) //{ // string bCode = " "; // AdvisorDao advisorDao; // try // { // advisorDao = new AdvisorDao(); // bCode = advisorDao.GetBusinessCode(businessType, path); // } // catch (BaseApplicationException Ex) // { // throw Ex; // } // catch (Exception Ex) // { // BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); // NameValueCollection FunctionInfo = new NameValueCollection(); // FunctionInfo.Add("Method", "AdvisorBo.cs:getBusinessCode()"); // object[] objects = new object[2]; // objects[0] = businessType; // objects[1] = path; // FunctionInfo = exBase.AddObject(FunctionInfo, objects); // exBase.AdditionalInformation = FunctionInfo; // ExceptionManager.Publish(exBase); // throw exBase; // } // return bCode; //} /// <summary> /// /// </summary> /// <param name="advisorVo"></param> /// <returns></returns> public bool UpdateAdvisorUser(AdvisorVo advisorVo) { bool bResult = false; AdvisorDao advisorDao = new AdvisorDao(); try { bResult = advisorDao.UpdateAdvisorUser(advisorVo); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:updateAdvisorUser()"); object[] objects = new object[1]; objects[0] = advisorVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }
/// <summary> /// Get all Classification List of the advisor /// </summary> /// <param name="adviserId"></param> /// <returns></returns> public DataSet GetAdviserClassification(int adviserId) { AdvisorDao advisorDao = new AdvisorDao(); DataSet dsAdviserClassification; try { dsAdviserClassification = advisorDao.GetAdviserClassification(adviserId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserClassification(int adviserId)"); object[] objects = new object[1]; objects[0] = adviserId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dsAdviserClassification); }
/// <summary> /// /// </summary> /// <param name="CustomerName"></param> /// <param name="advisorId"></param> /// <param name="CurrentPage"></param> /// <param name="Count"></param> /// <param name="SortExpression"></param> /// <param name="NameFilter"></param> /// <param name="AreaFilter"></param> /// <param name="PincodeFilter"></param> /// <param name="ParentFilter"></param> /// <param name="RMFilter"></param> /// <param name="genDictParent"></param> /// <param name="genDictRM"></param> /// <param name="genDictReassignRM"></param> /// <returns></returns> public List <CustomerVo> FindCustomer(string CustomerName, int advisorId, int CurrentPage, out int Count, string SortExpression, string NameFilter, string AreaFilter, string PincodeFilter, string ParentFilter, string RMFilter, out Dictionary <string, string> genDictParent, out Dictionary <string, string> genDictRM, out Dictionary <string, string> genDictReassignRM) { List <CustomerVo> CustomerList = new List <CustomerVo>(); AdvisorDao advisorDao = new AdvisorDao(); genDictParent = new Dictionary <string, string>(); genDictRM = new Dictionary <string, string>(); genDictReassignRM = new Dictionary <string, string>(); Count = 0; try { CustomerList = advisorDao.FindCustomer(CustomerName, advisorId, CurrentPage, out Count, SortExpression, NameFilter, AreaFilter, PincodeFilter, ParentFilter, RMFilter, out genDictParent, out genDictRM, out genDictReassignRM); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:FindCustomer()"); object[] objects = new object[2]; objects[0] = CustomerName; objects[1] = advisorId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(CustomerList); }
/// <summary> /// /// </summary> /// <param name="userId"></param> /// <returns></returns> public AdvisorVo GetAdvisorUser(int userId) { AdvisorVo advisorVo = null; AdvisorDao advisorDao = new AdvisorDao(); try { advisorVo = advisorDao.GetAdvisorUser(userId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdvisorUser()"); object[] objects = new object[1]; objects[0] = userId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(advisorVo); }
/// <summary> /// /// </summary> /// <param name="adviserId"></param> /// <param name="smsLincence"></param> /// <returns>bool Result</returns> public bool UpdateAdviserSMSLicence(int adviserId, int smsLincence) { bool bResult = false; AdvisorDao adviserDao = new AdvisorDao(); try { bResult = adviserDao.UpdateAdviserSMSLicence(adviserId, smsLincence); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:UpdateAdviserSMSLicence(int adviserId, int smsLincence)"); object[] objects = new object[2]; objects[0] = adviserId; objects[1] = smsLincence; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }
/// <summary> /// /// </summary> /// <param name="adviserId"></param> /// <param name="Flag"></param> /// <returns>int count</returns> public int GetAdviserCustomerList(int adviserId, string Flag) { AdvisorDao advisorDao = new AdvisorDao(); int count; try { count = advisorDao.GetAdviserCustomerList(adviserId, Flag); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserCustomerList()"); object[] objects = new object[2]; objects[0] = adviserId; objects[1] = Flag; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(count); }
/// <summary> /// /// </summary> /// <param name="smsVoList"></param> /// <param name="adviserId"></param> /// <param name="smsType"></param> /// <returns>bool Result</returns> public bool AddToAdviserSMSLog(List <SMSVo> smsVoList, int adviserId, string smsType) { bool bResult = false; AdvisorDao adviserDao = new AdvisorDao(); try { for (int i = 0; i < smsVoList.Count; i++) { bResult = AddToAdviserSMSLog(smsVoList[i], adviserId, smsType); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:AddToAdviserSMSLog(List<SMSVo> smsVoList, int adviserId, string smsType)"); object[] objects = new object[2]; objects[0] = adviserId; objects[1] = smsVoList; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }
/// <summary> /// /// </summary> /// <param name="adviserId"></param> /// <param name="namefilter"></param> /// <returns>List of CustomerVo</returns> public List <CustomerVo> GetAdviserCustomersForSMS(int adviserId, string namefilter) { List <CustomerVo> customerList = new List <CustomerVo>(); AdvisorDao adviserDao = new AdvisorDao(); try { customerList = adviserDao.GetAdviserCustomersForSMS(adviserId, namefilter); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserCustomersForSMS(int adviserId, string namefilter)"); object[] objects = new object[2]; objects[0] = adviserId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(customerList); }
/// <summary> /// Function to retrieve the potential home page fot a user /// </summary> /// <param name="adviserId"></param> /// <returns></returns> public DataSet GetUserPotentialHomepages(int adviserId, string userRole) { AdvisorDao advisorDao = new AdvisorDao(); DataSet dsUserPotentialHomepage; try { dsUserPotentialHomepage = advisorDao.GetUserPotentialHomepages(adviserId, userRole); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetUserPotentialHomepages()"); object[] objects = new object[2]; objects[0] = adviserId; objects[1] = userRole; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dsUserPotentialHomepage); }
/// <summary> /// Function to retrieve the tree nodes based on the user role /// </summary> /// <param name="adviserId"></param> /// <returns></returns> public DataSet GetTreeNodesBasedOnUserRoles(string userRole, string treeType, int adviserId) { AdvisorDao advisorDao = new AdvisorDao(); DataSet dsAdviserTreeNodes; try { dsAdviserTreeNodes = advisorDao.GetTreeNodesBasedOnUserRoles(userRole, treeType, adviserId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetTreeNodesBasedOnUserRoles(string userRole)"); object[] objects = new object[1]; objects[0] = userRole; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dsAdviserTreeNodes); }
/// <summary> /// Get domain name for the adviser for login widget /// </summary> /// <param name="adviserId"></param> /// <returns></returns> public string GetAdviserDomainName(int adviserId) { string domain = ""; AdvisorDao adviserDao = new AdvisorDao(); try { domain = adviserDao.GetAdviserDomainName(adviserId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserDomainName(int adviserId)"); object[] objects = new object[1]; objects[0] = adviserId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(domain); }
/// <summary> /// Returns Adviser's Customer Object List based on Adviser Id and the filters /// </summary> /// <param name="adviserId"></param> /// <param name="CurrentPage"></param> /// <param name="Count"></param> /// <param name="SortExpression"></param> /// <param name="NameFilter"></param> /// <param name="AreaFilter"></param> /// <param name="PincodeFilter"></param> /// <param name="ParentFilter"></param> /// <param name="RMFilter"></param> /// <param name="genDictParent"></param> /// <param name="genDictRM"></param> /// <param name="genDictReassignRM"></param> /// <returns>List of CustomerVo</returns> public List <CustomerVo> GetAdviserCustomerList(int adviserId, int CurrentPage, out int Count, string SortExpression, string panFilter, string NameFilter, string AreaFilter, string PincodeFilter, string ParentFilter, string RMFilter, string Active, out Dictionary <string, string> genDictParent, out Dictionary <string, string> genDictRM, out Dictionary <string, string> genDictReassignRM) { List <CustomerVo> customerList = null; AdvisorDao advisorDao = new AdvisorDao(); genDictParent = new Dictionary <string, string>(); genDictRM = new Dictionary <string, string>(); Count = 0; try { customerList = advisorDao.GetAdviserCustomerList(adviserId, CurrentPage, out Count, SortExpression, panFilter, NameFilter, AreaFilter, PincodeFilter, ParentFilter, RMFilter, Active, out genDictParent, out genDictRM, out genDictReassignRM); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:GetAdviserCustomerList()"); object[] objects = new object[11]; objects[0] = adviserId; objects[1] = CurrentPage; objects[2] = Count; objects[3] = SortExpression; objects[4] = NameFilter; objects[5] = AreaFilter; objects[6] = PincodeFilter; objects[7] = ParentFilter; objects[8] = RMFilter; objects[9] = genDictParent; objects[10] = genDictRM; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(customerList); }
/// <summary> /// Creates User Account for an Adviser /// </summary> /// <param name="advisorVo"></param> /// <param name="userId"></param> /// <param name="password"></param> /// <returns>bool result</returns> public bool CreateAdvisorUser(AdvisorVo advisorVo, int userId, string password) { bool bResult = false; UserVo userVo = new UserVo(); UserDao userDao = new UserDao(); AdvisorDao advisorDao = new AdvisorDao(); Random id = new Random(); try { userVo.Email = advisorVo.Email; userVo.FirstName = advisorVo.ContactPersonFirstName.ToString(); userVo.MiddleName = advisorVo.ContactPersonMiddleName.ToString(); userVo.LastName = advisorVo.ContactPersonMiddleName.ToString(); userVo.Password = id.Next(10000, 99999).ToString(); userVo.UserType = "Advisor"; userVo.UserId = userId; userDao.CreateUser(userVo); bResult = true; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdvisorBo.cs:CreateAdvisorUser()"); object[] objects = new object[1]; objects[0] = advisorVo; objects[1] = userId; objects[2] = password; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }