Exemplo n.º 1
0
        private ClientSpouse getSpousePersonalInfo(int clientId)
        {
            ClientSpouse clientSpouseObj = new ClientSpouse();

            try
            {
                FinancialPlanner.Common.JSONSerialization jsonSerialization = new FinancialPlanner.Common.JSONSerialization();
                string apiurl = Program.WebServiceUrl + "/" + string.Format(GET_SPOUSE_PERSONAL_API, clientId);

                RestAPIExecutor restApiExecutor = new RestAPIExecutor();

                var restResult = restApiExecutor.Execute <Client>(apiurl, null, "GET");

                if (jsonSerialization.IsValidJson(restResult.ToString()))
                {
                    clientSpouseObj = jsonSerialization.DeserializeFromString <ClientSpouse>(restResult.ToString());
                }
                return(clientSpouseObj);
            }
            catch (Exception ex)
            {
                Logger.LogDebug(ex);
                return(null);
            }
        }
Exemplo n.º 2
0
        //private const string DELETE_QUERY = "DELETE FROM USERS WHERE ID = {0}";

        public ClientSpouse Get(int id)
        {
            ClientSpouse clientSpouse = new ClientSpouse();

            DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ID, id));

            foreach (DataRow dr in dtAppConfig.Rows)
            {
                clientSpouse = convertToClientSpouseObject(dr);
            }
            return(clientSpouse);
        }
Exemplo n.º 3
0
        public Result Update(ClientSpouse clientSpouse)
        {
            var result = new Result();

            try
            {
                ClientSpouseService clientSpouseService = new ClientSpouseService();
                clientSpouseService.Update(clientSpouse);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
Exemplo n.º 4
0
        private bool updateClientSpousePersonalInfo(ClientSpouse spouse)
        {
            try
            {
                FinancialPlanner.Common.JSONSerialization jsonSerialization = new FinancialPlanner.Common.JSONSerialization();
                string apiurl = Program.WebServiceUrl + "/" + UPDATE_CLIENTSPOUSE_PERSONAL_INFO_API;

                RestAPIExecutor restApiExecutor = new RestAPIExecutor();

                var restResult = restApiExecutor.Execute <ClientSpouse>(apiurl, spouse, "POST");

                return(true);
            }
            catch (Exception ex)
            {
                Logger.LogDebug(ex);
                return(false);
            }
        }
Exemplo n.º 5
0
        public void Update(ClientSpouse clientSpouse)
        {
            try
            {
                string value         = DataBase.DBService.ExecuteCommandScalar(string.Format(IS_RECORD_EXIST, clientSpouse.ClientId));
                bool   isRecordExist = (value.Equals("0")) ? false : true;
                if (isRecordExist)
                {
                    DataBase.DBService.ExecuteCommand(string.Format(UPDATE_QUERY,
                                                                    clientSpouse.Name, clientSpouse.FatherName, clientSpouse.MotherName,
                                                                    clientSpouse.Gender, clientSpouse.DOB.ToString("yyyy-MM-dd"), clientSpouse.PAN,
                                                                    clientSpouse.Aadhar, clientSpouse.PlaceOfBirth, clientSpouse.IsMarried,
                                                                    ((clientSpouse.MarriageAnniversary == null) ? null : clientSpouse.MarriageAnniversary.Value.ToString("yyyy-MM-dd")),
                                                                    clientSpouse.Occupation, clientSpouse.IncomeSlab,
                                                                    clientSpouse.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), clientSpouse.UpdatedBy, clientSpouse.ClientId));

                    Activity.ActivitiesService.Add(ActivityType.UpdateClientSpouse, EntryStatus.Success,
                                                   Source.Server, clientSpouse.UpdatedByUserName, clientSpouse.Name, clientSpouse.MachineName);
                }
                else
                {
                    DataBase.DBService.ExecuteCommand(string.Format(INSERT_QUERY,
                                                                    clientSpouse.ClientId,
                                                                    clientSpouse.Name, clientSpouse.FatherName, clientSpouse.MotherName,
                                                                    clientSpouse.Gender, clientSpouse.DOB.ToString("yyyy-MM-dd"), clientSpouse.PAN,
                                                                    clientSpouse.Aadhar, clientSpouse.PlaceOfBirth, clientSpouse.IsMarried,
                                                                    ((clientSpouse.MarriageAnniversary == null) ? null : clientSpouse.MarriageAnniversary.Value.ToString("yyyy-MM-dd")), clientSpouse.Occupation, clientSpouse.IncomeSlab,
                                                                    clientSpouse.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), clientSpouse.CreatedBy, clientSpouse.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), clientSpouse.UpdatedBy));


                    Activity.ActivitiesService.Add(ActivityType.UpdateClientSpouse, EntryStatus.Success,
                                                   Source.Server, clientSpouse.UpdatedByUserName, clientSpouse.Name, clientSpouse.MachineName);
                }
            }
            catch (Exception ex)
            {
                FinancialPlanner.Common.Logger.LogDebug(ex.Message);
            }
        }
Exemplo n.º 6
0
        private ClientSpouse convertToClientSpouseObject(DataRow dr)
        {
            ClientSpouse client = new ClientSpouse();

            client.ID                  = dr.Field <int>("ID");
            client.ClientId            = dr.Field <int>("CID");
            client.Name                = dr.Field <string>("Name");
            client.DOB                 = dr.Field <DateTime>("DOB");
            client.Gender              = dr.Field <string>("Gender");
            client.PAN                 = dr.Field <string>("PAN");
            client.Aadhar              = dr.Field <string>("AADHAR");
            client.PlaceOfBirth        = dr.Field <string>("PlaceOfBirth");
            client.IsMarried           = dr.Field <bool>("Married");
            client.MarriageAnniversary = dr.Field <DateTime>("MarriageAnniversary");
            client.FatherName          = dr.Field <string>("FatherName");
            client.MotherName          = dr.Field <string>("MotherName");
            client.Occupation          = dr.Field <string>("Occupation");
            client.IncomeSlab          = dr.Field <string>("IncomeSlab");
            client.UpdatedOn           = dr.Field <DateTime>("UpdatedOn");
            client.UpdatedBy           = dr.Field <int>("UpdatedBy");
            client.UpdatedByUserName   = dr.Field <string>("UpdatedByUserName");
            return(client);
        }