Esempio n. 1
0
        public DataSet GetDepartDetails(EmpDepartment objEmpDep)
        {
            //Hashtable htparams = new Hashtable
            //                                       {
            //                                             {"inDepartment_Id",objEmpDep.DepartmentId},
            //                                             {"inDepartment",objEmpDep.Department},



            //                                       };
            return(ExecuteDataSet("get_Department"));
        }
Esempio n. 2
0
        public int InsertEmpDep(EmpDepartment objEmpDep)
        {
            Hashtable htParams = new Hashtable
            {
                { "inDepartment_Id", objEmpDep.DepartmentId },
                { "inDepartment", objEmpDep.Department },
                { "inCompanyCode", objEmpDep.CompanyCode },
                { "in_OpName", objEmpDep.OpName },
            };

            return(ExecuteNonQuery("EmpDepartment", htParams));
        }
Esempio n. 3
0
        public DataSet GetDepart(EmpDepartment objEmpDep)
        {
            Hashtable htparams = new Hashtable
            {
                { "inDepartment_Id", objEmpDep.DepartmentId },
                { "inDepartment", objEmpDep.Department },
                { "inCompanyCode", objEmpDep.CompanyCode },
                { "in_OpName", objEmpDep.OpName },
            };

            return(ExecuteDataSet("EmpDepartment", htparams));
        }
Esempio n. 4
0
        public JsonResult UpdateDepartment(EmpDepartment department)
        {
            CommonResponse cr = new CommonResponse();

            try
            {
                var pro = _context.EmpDepartment.Where(e => e.DepartmentID == department.DepartmentID).FirstOrDefault();
                pro.DepartmentName = department.DepartmentName;
                pro.DisOrder       = department.DisOrder;
                pro.UpdateDate     = DateTime.Now;
                pro.UpdateBy       = User.Identity.Name;
                pro.SetDate();
                _context.EmpDepartment.Update(pro);
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                cr.message = ex.Message;
                cr.results = Constant.FAILED;
            }
            return(new JsonResult(cr));
        }
Esempio n. 5
0
        public JsonResult AddDepartment([FromBody] EmpDepartment department)
        {
            CommonResponse cr = new CommonResponse();

            try
            {
                var isExist = DataAccess.Instance.CommonServices.IsExist("Emp_Department", "DepartmentName = '" + department.DepartmentName + "' ");
                if (isExist)
                {
                    throw new Exception("Department Already Exist.");
                }
                department.AddDate = DateTime.Now;
                department.AddBy   = User.Identity.Name;
                department.SetDate();
                _context.EmpDepartment.Add(department);
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                cr.message = ex.Message;
                cr.results = Constant.FAILED;
            }
            return(new JsonResult(cr));
        }