public string AddEmployee(string name, string phone, string email, string address, bool gender, string qualification, string img_path)
 {
     try
     {
         Emp_Table emp = new Emp_Table();
         emp.Name          = name;
         emp.Phone         = phone;
         emp.Email         = email;
         emp.Address       = address;
         emp.Gender        = gender;
         emp.Qualification = qualification;
         FileStream   fs = new FileStream(img_path, FileMode.Open, FileAccess.Read);
         BinaryReader br = new BinaryReader(fs);
         emp.Image    = br.ReadBytes((int)fs.Length);
         emp.Password = "******";
         emp.Admin    = false;
         connection.Emp_Tables.InsertOnSubmit(emp);
         connection.SubmitChanges();
         var        query = from a in connection.Emp_Tables where a.Id == connection.Emp_Tables.Max(ab => ab.Id) select a;
         Emp_Detail edt   = new Emp_Detail();
         edt.Emp_Id      = query.First().Id;
         edt.Curr_Status = (byte)1;
         connection.Emp_Details.InsertOnSubmit(edt);
         connection.SubmitChanges();
         return("Employee Information Saved!");
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
 public bool postNotice(int id, string Notice)
 {
     try
     {
         var        query = from a in connection.Emp_Details where a.Emp_Id == id select a;
         Emp_Detail emp   = query.First();
         emp.Notice = Notice;
         connection.SubmitChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool setStatus(int id, int bit)
 {
     try
     {
         var        query = from a in connection.Emp_Details where a.Emp_Id == id select a;
         Emp_Detail emp   = query.First();
         emp.Curr_Status = (byte)bit;
         connection.SubmitChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 4
0
 partial void DeleteEmp_Detail(Emp_Detail instance);
Esempio n. 5
0
 partial void UpdateEmp_Detail(Emp_Detail instance);
Esempio n. 6
0
 partial void InsertEmp_Detail(Emp_Detail instance);