Ejemplo n.º 1
0
        public JsonResult Submit()
        {
            var model = this.DeserializeObject <SpreadsheetSubmitViewModel>("models");

            if (model != null && model.Created != null)
            {
                CompanyRepository.Insert(model.Created);
            }

            if (model != null && model.Updated != null)
            {
                CompanyRepository.Update(model.Updated);
            }

            if (model != null && model.Destroyed != null)
            {
                CompanyRepository.Delete(model.Destroyed);
            }

            return(this.Jsonp(model));
        }
Ejemplo n.º 2
0
 public static bool Delete(int companyId)
 {
     return(CompanyRepository.Delete(companyId));
 }
        public ActionResult Delete(int companyId)
        {
            repo.Delete(companyId);

            return(RedirectToAction("GetAll"));
        }
Ejemplo n.º 4
0
 public void DeleteCompany(int id)
 {
     _companyRepository.Delete(id);
 }
 public void DeleteCompany(Company company)
 {
     _companyRepository.Delete(company.Id);
 }
Ejemplo n.º 6
0
    protected void OnMyAjaxManagerAjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument.IndexOf("RebindContactGrid") != -1)
        {
            //System.Threading.Thread.Sleep(1000);
            //divContact.Visible = true;
            //divContact.Style.Add("display", "block");
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, CompanyContactGrid);
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, pnlAddContact);
            string[] args = e.Argument.Split('/');
            if (args.Length == 3)
            {
                try
                {
                    int companyID = Int32.Parse(args[1]);
                    int rowIndex = Int32.Parse(args[2]);
                    CompanyGrid.MasterTableView.ClearSelectedItems();
                    CompanyGrid.MasterTableView.Items[rowIndex - 1].Selected = true;
                }
                catch (Exception ex) { throw ex; }
                CompanyContactGrid.Rebind();
            }
        }
        else if (e.Argument.IndexOf("RebindContactInfoGrid") != -1)
        {
            //divContactInfo.Style.Add("display","block");
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, ContactInfoGrid);
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, pnlAddContactInfo);
            string[] args = e.Argument.Split('/');
            if (args.Length == 3)
            {
                try
                {
                    int contactID = Int32.Parse(args[1]);
                    int rowIndex = Int32.Parse(args[2]);
                    CompanyContactGrid.MasterTableView.ClearSelectedItems();
                    CompanyContactGrid.MasterTableView.Items[rowIndex - 1].Selected = true;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                ContactInfoGrid.Rebind();
            }

        }
        else if (e.Argument.IndexOf("AddCompanyContact") != -1)
        {
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, CompanyContactGrid);
            string[] args = e.Argument.Split('/');
            if (args.Length == 2)
            {
                try
                {
                    int companyID = Int32.Parse(args[1]);
                    CompanyContactRepository contactRepo = new CompanyContactRepository();
                    CompanyContact contact = new CompanyContact();
                    contact.CompanyID = companyID;
                    contact.LastName = txtLastName.Text.Trim();
                    contact.FirstName = txtFirstName.Text.Trim();
                    contact.Position = ddlFunction.Text;

                    contactRepo.Insert(contact);

                    CompanyContactGrid.Rebind();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        else if (e.Argument.IndexOf("AddContactInfo") != -1)
        {
            CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, ContactInfoGrid);
            string[] args = e.Argument.Split('/');
            if (args.Length == 2)
            {
                try
                {
                    int contactID = Int32.Parse(args[1]);
                    CompanyContactTelephoneRepository contactInfoRepo = new CompanyContactTelephoneRepository();
                    CompanyContactTelephone contactInfo = new CompanyContactTelephone();
                    contactInfo.ContactID = contactID;
                    contactInfo.Type = ddlType.SelectedValue;
                    contactInfo.TelephoneZone = txtPhoneZone.Text.Trim();
                    contactInfo.Tel = txtInfo.Text.Trim();
                    contactInfo.Location = txtPlace.Text.Trim();

                    contactInfoRepo.Insert(contactInfo);

                    ContactInfoGrid.Rebind();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        else if (e.Argument.IndexOf("DeleteSelectedCompany") != -1)
        {
            if (CompanyGrid.SelectedItems.Count == 1)
            {
                CompanyAjaxManager.AjaxSettings.AddAjaxSetting(CompanyAjaxManager, CompanyGrid);
                CompanyRepository companyRepo = new CompanyRepository();
                companyRepo.Delete(new Company(GetSelectedCompanyID()));
                CompanyGrid.Rebind();
            }
        }
        else if (e.Argument.IndexOf("OpenSeletectedCompany") != -1)
        {
            if (CompanyGrid.SelectedItems.Count == 1)
            {
                Response.Redirect(string.Format("~/CompanyProfile.aspx?CompanyId={0}&mode=edit&backurl=visible", GetSelectedCompanyID()), true);
            }
        }
        else if (e.Argument.IndexOf("ViewCompanyActions") != -1)
        {
            if (CompanyGrid.SelectedItems.Count == 1)
            {
                Response.Redirect(string.Format("~/CompanyProfile.aspx?CompanyId={0}&tab=action&mode=edit&backurl=visible", GetSelectedCompanyID()), true);
            }
        }
        else if (e.Argument.IndexOf("ViewCompanyJobs") != -1)
        {
            if (CompanyGrid.SelectedItems.Count == 1)
            {
                Response.Redirect(string.Format("~/CompanyProfile.aspx?CompanyId={0}&tab=job&mode=edit&backurl=visible", GetSelectedCompanyID()), true);
            }
        }
        else if (e.Argument.IndexOf("ViewCompanyInvoices") != -1)
        {
            if (CompanyGrid.SelectedItems.Count == 1)
            {
                Response.Redirect(string.Format("~/InvoicesPage.aspx?type=search&customer={0}", GetSelectedCompanyID()), true);
            }
        }
    }
Ejemplo n.º 7
0
 public void DeleteCompany(int Id)
 {
     var repository = new CompanyRepository(_db);
     repository.Delete(Id);
     repository.Save();
 }
Ejemplo n.º 8
0
 public void ParaDel(IEnumerable <long> ids)
 {
     comRepo.Delete(ids);
 }
Ejemplo n.º 9
0
        public ActionResult Delete(int id)
        {
            companyRepo.Delete(id);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 10
0
 public void TearDown()
 {
     _companyRepository.Delete(_simpleCompany.IdCompany);
     _projectRepository.Delete(_simpleProject.IdProject);
     _projectRepository.Delete(_projectTwo.IdProject);
 }
Ejemplo n.º 11
0
 private void btnDeleteCompany_Click(object sender, EventArgs e)
 {
     c1.Delete((int)comboBox1.SelectedValue);
     GetCompany();
     GetDataGrid();
 }
Ejemplo n.º 12
0
 public bool Delete(int id, HttpContext current = null) => _companyRepository.Delete(id);