private void AddEditCompany(NameValueCollection forms, List<CompanyProfile> collectioncompanies, out string strResponse) { CompanyProfile objCompany = new CompanyProfile(); objCompany.CompanyID = Convert.ToInt32(forms.Get("CompanyId").ToString()); objCompany.CompanyName = forms.Get("CompanyName"); objCompany.Domain = forms.Get("Domain"); objCompany.Address = forms.Get("Address"); objCompany.Branches = forms.Get("Branches"); objCompany.UrlLink = forms.Get("UrlLink"); objCompany.EmailID = forms.Get("EmailID"); objCompany.PhNum = forms.Get("PhNum"); objCompany.NoofEmp = Convert.ToInt32(forms.Get("NoofEmp").ToString()); int res = new DDLDataBO().UpdateCompany(objCompany); if (res == 1) { strResponse = "Employee record successfully updated"; } else { strResponse = "Something went wrong"; } }
protected void AddCompany_Click(object sender, EventArgs e) { try { CompanyProfile objCompany = new CompanyProfile(); if (fuCompanyImageUrl.HasFile) { byte[] imageBytes = new byte[fuCompanyImageUrl.PostedFile.InputStream.Length + 1]; string filename = Path.GetFileName(fuCompanyImageUrl.PostedFile.FileName); string FName = txtName.Text + "_" + filename; fuCompanyImageUrl.SaveAs(Server.MapPath("~/Company_Images/" + FName)); objCompany.ImageUrl = "~/Company_Images/" + FName; } objCompany.CompanyName = txtName.Text; objCompany.Domain = txtCompanyDomain.Text; objCompany.Address = txtCompanyAddress.Text; objCompany.AboutUs = txtAboutCompany.Text; objCompany.Branches = txtBranches.Text; objCompany.UrlLink = txtCompanyUrl.Text; objCompany.NoofEmp = Convert.ToInt32(txtNoofEmp.Text); objCompany.PhNum = txtCompanyPhNum.Text; objCompany.EmailID = txtCompanyEmailID.Text; objCompany.EmployerID = Convert.ToInt32(Session["ID"].ToString()); objCompany.InsertedDate = DateTime.Now; objCompany.UpdatedDate = DateTime.Now; int i = new AddJobBO().InsertNew<CompanyProfile>(objCompany); if (i == 1) { Response.Redirect("ProfileEmployer.aspx"); } if (i == 0) { lblAddError.Text = "Something Went Wrong"; } else { lblAddError.Text = ""; } } catch (Exception) { throw; } }