コード例 #1
0
        public DataValidationModel <object> CustometInsertOrUpdate(CustomerIUModel customer)

        {
            try
            {
                string message       = string.Empty;
                var    parameterList = new List <Tuple <string, object> >
                {
                    Tuple.Create("@CustomerId", customer.CustomerId == null ? default(int) : customer.CustomerId),
                    Tuple.Create("@ContactEmail", customer.ContactEmail),
                    Tuple.Create("@LoginPassword", MasterHelperService.EncodePasswordToBase64(customer.LoginPassword)),
                    Tuple.Create("@FirstName", customer.FirstName),
                    Tuple.Create("@LastName", customer.LastName),
                    Tuple.Create("@Address1", customer.Address1),
                    Tuple.Create("@Address2", customer.Address2),
                    Tuple.Create("@ContactMobile", customer.ContactMobile),
                };

                DataSet executedSP = MasterHelperService.SqlConnectionSPHelper("SaveCustomer", parameterList);



                var isExist = false; var isNewCreated = false; var id = default(int);
                for (int i = 0; i < executedSP.Tables[0].Rows.Count; i++)
                {
                    isExist      = Convert.ToBoolean(executedSP.Tables[0].Rows[i]["IsExist"]);
                    isNewCreated = Convert.ToBoolean(executedSP.Tables[0].Rows[i]["IsNewCreated"]);
                    id           = Convert.ToInt32(executedSP.Tables[0].Rows[i]["Id"]);
                }


                return(new DataValidationModel <object>()
                {
                    Data = GetCustomerById(id),
                    IsExist = isExist,
                    ErrorMessage = null
                });
            }
            catch (Exception ex)
            {
                //return new DataValidationModel<string>()
                //{
                //    Data = "Something went wrong",
                //    ErrorMessage = "Failed"
                //};
                throw ex;
            }
        }
コード例 #2
0
 public DataValidationModel <object> CustometInsertOrUpdate(CustomerIUModel customer)
 {
     NLogManager.Info("CustomerManager - Customer Insert Or Update");
     return(_portalRepository.CustometInsertOrUpdate(customer));
 }
コード例 #3
0
 public DataValidationModel <object> CustometInsertOrUpdate(CustomerIUModel customer)
 {
     return(_portalManager.CustometInsertOrUpdate(customer));
 }