Example #1
0
        public int AddEmployer(LoginEmployer ObjEmp, Employer ObjE)
        {
            try
            {
                _unitOfWork.Repository<Employer>().Insert(ObjE);
                //_unitOfWork.Save();
                ObjEmp.EmployerID = _unitOfWork.Repository<Employer>().GetAll().Where(c => c.EmailID == ObjE.EmailID).Select(c => c.EmpID).FirstOrDefault();
                _unitOfWork.Repository<LoginEmployer>().Insert(ObjEmp);
                _unitOfWork.Save();
                return 1;
            }
            catch (Exception)
            {

                return 0;
            }

            //using (JobASPContext context = new JobASPContext())
            //{
            //    try
            //    {
            //        context.Employees.Add(ObjE);
            //        context.SaveChanges();
            //        ObjEmp.EmployerID = context.Employees.Where(c => c.EmailID == ObjEmp.EmailID).Select(c => c.EmpID).FirstOrDefault();
            //        context.LoginEmployer.Add(ObjEmp);
            //        context.SaveChanges();
            //        return 1;
            //    }
            //    catch (Exception)
            //    {

            //        return 0;
            //    }

            //}
        }
Example #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                    Employer Obj = new Employer();
                    Obj.EmpName = txtName.Text;
                    Obj.EmpLName = txtLName.Text;
                    Obj.Gender = ddlGender.SelectedItem.Text;
                    Obj.Designation = txtDesignation.Text;
                    if (!String.IsNullOrWhiteSpace(txtCompany.Text))
                    {
                        Obj.CompanyName = txtCompany.Text;
                    }
                    else
                    {
                        Obj.CompanyName = String.Empty;
                    }
                    if (!String.IsNullOrWhiteSpace(txtContactTitle.Text))
                    {
                        Obj.ContactTitle = txtContactTitle.Text;
                    }
                    else
                    {
                        Obj.ContactTitle = String.Empty;
                    }
                    if (!String.IsNullOrWhiteSpace(txtAddress.Text))
                    {
                        Obj.Address = txtAddress.Text;
                    }
                    else
                    {
                        Obj.Address = String.Empty;
                    }
                    Obj.Country =Convert.ToInt32(ddlCountry.SelectedItem.Value);
                    Obj.State =Convert.ToInt32(ddlState.SelectedItem.Value);
                    Obj.City = Convert.ToInt32(ddlCity.SelectedItem.Value);
                    Obj.PostalCode = txtPostalCode.Text;
                    Obj.Phone = txtPhNum.Text;
                    Obj.EmailID = txtEmailID.Text;
                    LoginEmployer objLogEmp = new LoginEmployer();
                    objLogEmp.EmailID = txtEmailID.Text;
                    objLogEmp.Password = txtPassword.Text;
                    int val = new RegisterBO().AddEmployer(objLogEmp, Obj);
                    if (val == 1)
                    {
                        //sms sending
                        SMS.APIType = SMSGateway.Site2SMS;
                        string message = "Hello..! you registered in successful" ;
                        SMS.MashapeKey = "7c4xATbTr7mshehqdw53rmcYbfOtp1WdEtbjsnOU2FJvTrjeQs";
                        SMS.Username = "******";
                        SMS.Password = "******";
                       if (txtPhNum.Text != "")
                       {
                           string num = txtPhNum.Text.Trim();
                            SMS.SendSms(num, message);
                       }
                        ////////////

                        new CCDDLWebService().SendMail(txtEmailID.Text, "Employer");
                        Response.Redirect("Login.aspx");
                    }
                    else
                    {
                        lblRegError.Text = "Something went wrong";
                    }

            }
            catch (Exception)
            {
                lblRegError.Text = "Something went wrong";
            }
        }
Example #3
0
 public int UpdateEmployer(Employer objEmployer)
 {
     try
     {
         var data = _unitOfWork.Repository<Employer>().FindById(objEmployer.EmpID);
         data.EmpName = objEmployer.EmpName;
         data.EmpLName = objEmployer.EmpLName;
         data.CompanyName = objEmployer.CompanyName;
         data.Address = objEmployer.Address;
         data.Country = objEmployer.Country;
         data.State = objEmployer.State;
         data.City = objEmployer.City;
         data.Designation = objEmployer.Designation;
         data.PostalCode = objEmployer.PostalCode;
         data.Phone = objEmployer.Phone;
         _unitOfWork.Repository<Employer>().Update(data);
         _unitOfWork.Save();
         return 1;
     }
     catch
     {
         return 0;
     }
     finally
     {
         objEmployer = null;
     }
 }
Example #4
0
        protected void rptProfileEdit_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                RepeaterItem item = rptProfileEdit.Items[0];

                Employer objEmp = new Employer();
                objEmp.EmpID = Convert.ToInt32(Session["ID"].ToString());
                objEmp.EmpName = (item.FindControl("txtName") as TextBox).Text;
                objEmp.EmpLName = (item.FindControl("txtLName") as TextBox).Text;
                objEmp.CompanyName = (item.FindControl("txtCompanyName") as TextBox).Text;
                objEmp.Address = (item.FindControl("txtAddress") as TextBox).Text;
                objEmp.Country = Convert.ToInt32((item.FindControl("ddlCountry") as DropDownList).SelectedValue);
                objEmp.State = Convert.ToInt32((item.FindControl("ddlState") as DropDownList).SelectedValue);
                objEmp.City = Convert.ToInt32((item.FindControl("ddlCity") as DropDownList).SelectedValue);
                objEmp.Designation = (item.FindControl("txtDesignation") as TextBox).Text;
                objEmp.PostalCode = (item.FindControl("txtPostalCode") as TextBox).Text;
                objEmp.Phone = (item.FindControl("txtPhone") as TextBox).Text;
                //objEmp.EmailID = (item.FindControl("txtEmailID") as TextBox).Text;
                int i = new RegisterBO().UpdateEmployer(objEmp);
                if (i == 1)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "AlertSuccess", "funcAlert();", true);
                    bindProfile();
                }
            }
            if (e.CommandName == "Cancel")
            {
                bindProfile();
            }
        }