コード例 #1
0
        public ResponseModel ModifyTemplate(int TemplateID, string TemplateName, string issueType, bool isTemplateActive, string templateSubject, string templateContent)
        {
            int           updateCount      = 0;
            ResponseModel objResponseModel = new ResponseModel();
            int           statusCode       = 0;
            string        statusMessage    = "";

            try
            {
                ////Get token (Double encrypted) and get the tenant id
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token));

                SettingsCaller newTemplate = new SettingsCaller();


                updateCount = newTemplate.UpdateTemplate(new TemplateService(Cache, Db), authenticate.TenantId, TemplateID, TemplateName, issueType, isTemplateActive,
                                                         authenticate.UserMasterID, templateSubject, templateContent);

                statusCode =
                    updateCount == 0 ?
                    (int)EnumMaster.StatusCode.InternalServiceNotWorking : (int)EnumMaster.StatusCode.Success;

                statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode);

                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = statusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = updateCount;
            }
            catch (Exception)
            {
                throw;
            }

            return(objResponseModel);
        }