protected void Page_Load(object sender, EventArgs e)
        {
            string             cname = Request.Params["cname"];
            HttpFileCollection files = Request.Files;
            HttpPostedFile     file  = files[0];

            file.SaveAs("logo_pic\\" + Session["uid"] + ".jpg");
            string          telephone      = Request.Params["phone"];
            ICompanyService companyService = new CompanyService();

            companyService.AddNewCompany(Convert.ToInt32(Session["uid"]), cname, telephone, Session["uid"] + ".jpg");
            Response.Redirect("hr-recruit-list.aspx");
        }
Example #2
0
 public ActionResult AddNewServiceProvider(CompanyViewModel model)
 {
     if (ModelState.IsValid)
     {
         var user   = User.Identity.Name;
         var login  = AccountService.GetLoginByEmail(user);
         var result = CompanyService.AddNewCompany(model, login, Request.Files);
         return(Json(new { Success = result.IsSuccess, Errors = result.ErrorMessage ?? "" }));
     }
     else
     {
         return(Json(new { Success = false }));
     }
 }