예제 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            GroupCompany groupCompany = db.GroupCompanies.Find(id);

            db.GroupCompanies.Remove(groupCompany);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "CompanyNumber,FullName,TelNumber,ShortName,EnglishName,LegalRepresentative,EstablishDate,Email,Address,Url,Logo,Remark")] GroupCompany groupCompany)
 {
     if (ModelState.IsValid)
     {
         db.Entry(groupCompany).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(groupCompany));
 }
 public List <GroupCompany> GetGroupCompany(GroupCompany model, UserContextModel objUser)
 {
     try
     {
         var data = _groupCompanyRepository.GetGroupCompany(model, objUser.CompanyCode);
         return(data);
     }
     catch (Exception ex)
     {
         var helper = new BusinessException(ex);
         throw helper.GetException();
     }
 }
 public List <GroupCompany> GetGroupCompany(GroupCompany model, string CompanyCode)
 {
     try
     {
         var parameters    = new string[] { "TransType" };
         var sqlParameterd = _dbHelper.CreateSqlParamByObj(model, parameters);
         return(_dbHelper.GetDataTableToList <GroupCompany>(CompanyCode, "[Company].[GroupCompanyDetails]", sqlParameterd));
     }
     catch (Exception ex)
     {
         var helper = new Helpers.ExceptionHelper.DataException(ex);
         throw helper.GetException();
     }
 }
예제 #5
0
        // GET: GroupCompany/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GroupCompany groupCompany = db.GroupCompanies.Find(id);

            if (groupCompany == null)
            {
                return(HttpNotFound());
            }
            return(View(groupCompany));
        }
예제 #6
0
        public ActionResult Create(GroupCompany groupCompany)
        {
            if (ModelState.IsValid)
            {
                db.GroupCompanies.Add(groupCompany);
                groupCompany.CompanyNumber = (new Random().Next(1111, 9999)).ToString();


                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(groupCompany));
        }
 public ApplicationResponse AddUpdateGroupCompany(GroupCompany model, string CompanyCode)
 {
     try
     {
         var       parameters    = new string[] { "TransType", "Id", "Name", "Code", "TypeId", "IncorporationDate", "Address", "CountryId", "StateId", "CityId", "PinCode", "ContcatNo", "WebSite", "PAN", "TAN", "GSTIN", "PF", "ESIC", "Logo", "CreatedBy", "ModifiedBy" };
         var       sqlParameterd = _dbHelper.CreateSqlParamByObj(model, parameters);
         DataTable dt            = _dbHelper.GetDataTable(CompanyCode, "[Company].[GroupCompanyDetails]", sqlParameterd);
         return(new ApplicationResponse
         {
             Code = Convert.ToInt32(dt.Rows[0][0]),
             Message = Convert.ToString(dt.Rows[0][1]),
         });
     }
     catch (Exception ex)
     {
         var helper = new Helpers.ExceptionHelper.DataException(ex);
         throw helper.GetException();
     }
 }
 public ApplicationResponse AddUpdateGroupCompany(GroupCompany model, UserContextModel objUser)
 {
     try
     {
         var validationResponse = _modelValidation.Validate(GroupCompanyValidation.ValidateAll_key, model, "Group company model can not be empty.");
         if (validationResponse.Messages != null && validationResponse.Messages.Count != 0)
         {
             throw new ValidationException(validationResponse);
         }
         model.CreatedBy = objUser.UserID;
         var data = _groupCompanyRepository.AddUpdateGroupCompany(model, objUser.CompanyCode);
         return(data);
     }
     catch (Exception ex)
     {
         var helper = new BusinessException(ex);
         throw helper.GetException();
     }
 }
예제 #9
0
 public HttpResponseMessage GetGroupCompany()
 {
     try
     {
         Log.Info("GroupCompanyController:GetGroupCompany", "Get Group Company  Start", string.Empty);
         GroupCompany model = new GroupCompany();
         model.TransType = "FETCH";
         UserContextModel objUser = new UserContextModel();
         objUser.UserID      = 1;
         objUser.CompanyCode = "devDB";
         var data = _groupCompanyService.GetGroupCompany(model, objUser);
         Log.Info("GroupCompanyController:GetGroupCompany", "Get Group Company END", string.Empty);
         return(this.Request.CreateResponse(HttpStatusCode.OK, data));
     }
     catch (Exception ex)
     {
         var helper = new AppPresentationException(ex);
         return(helper.GetResponse(this));
     }
 }