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



            //                                       };
            return(ExecuteDataSet("get_Department"));
        }
        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));
        }
        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));
        }
Exemple #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));
        }
Exemple #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));
        }