示例#1
0
        public HttpResponseMessage SetNewBranchStep2(CreateNewBranchStep2 _objCreateNewBranchStep2)
        {
            AgencyDAL objAgencyDAL = new AgencyDAL();
            Response  objResponse  = new Response();

            try
            {
                var jsonResult = new StringBuilder();
                jsonResult       = objAgencyDAL.SetNewBranchStep2(_objCreateNewBranchStep2);
                objResponse.Data = jsonResult.ToString();
                if (!string.IsNullOrEmpty(jsonResult.ToString()) && jsonResult.ToString() != "-1")
                {
                    objResponse.Success = true;
                }
                else
                {
                    objResponse.Success = false;
                }

                return(Request.CreateResponse(HttpStatusCode.OK, objResponse));
            }
            catch (Exception ex)
            {
                #region set exception response
                string logMsg = Environment.NewLine + DateTime.Now + Environment.NewLine + "Method Name: SetNewBranchStep2 | Contoller Name: Agency Controller" + Environment.NewLine;
                logMsg += "UserCategoryID:" + _objCreateNewBranchStep2.UserCategory + "|" + DateTime.Now + "|" + ex.ToString() + "-" + Environment.NewLine;
                ErrorHandler.ErrorLog(logMsg);
                #endregion
                objResponse.ErrorList.Add(new Error {
                    errorCode = "EX", errorMsg = ex.Message
                });
                objResponse.Success = false;
                return(Request.CreateResponse(HttpStatusCode.BadRequest, objResponse));
            }
        }
示例#2
0
 public StringBuilder SetNewBranchStep2(CreateNewBranchStep2 _objCreateNewBranchStep2)
 {
     try
     {
         SqlParameter[] P = new SqlParameter[] {
             new SqlParameter("@AgencyID", _objCreateNewBranchStep2.AgencyID),
             new SqlParameter("@TmpAGBrID", _objCreateNewBranchStep2.AgencyBranchID),
             new SqlParameter("@FirstName", _objCreateNewBranchStep2.FirstName),
             new SqlParameter("@LastName", _objCreateNewBranchStep2.LastName),
             new SqlParameter("@Mobile", _objCreateNewBranchStep2.Mobile),
             new SqlParameter("@Email", _objCreateNewBranchStep2.Email),
             new SqlParameter("@EmpCode", _objCreateNewBranchStep2.EmpCode),
             new SqlParameter("@CreatedBy", _objCreateNewBranchStep2.CreatedBy),
         };
         var jsonResult = new StringBuilder();
         jsonResult = DataLib.JsonStringExecuteReader(DataLib.Connection.SetConnectionString, SPKeys.SPSetAgencyBrachDetails, P);
         return(jsonResult);
     }
     catch { throw; }
 }