Exemple #1
0
    public static void get_Depart_Desig(DropDownList ddlDepartment, DropDownList ddlDesignation)
    {
        ddlDesignation.Items.Clear();

        DALDesignation objDALDesg = new DALDesignation();
        EmpDesignation objEmDesg  = new EmpDesignation();

        DataSet ds = new DataSet();

        objEmDesg.DepartmentId = ddlDepartment.SelectedValue.ToString();
        ds = objDALDesg.GetDesigDetails(objEmDesg);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlDesignation.DataSource = ds.Tables[0];
            ddlDesignation.Items.Clear();
            ddlDesignation.Items.Add(new ListItem("-Select-", "-1"));
            ddlDesignation.DataTextField  = "Designation";
            ddlDesignation.DataValueField = "Designation_Id";
            ddlDesignation.DataBind();
        }
        else
        {
            ddlDesignation.DataSource = null;
            ddlDesignation.DataBind();
        }
    }
Exemple #2
0
        public DataSet GetDesignationByDes(EmpDesignation objEmpDesg)
        {
            Hashtable htparams = new Hashtable
            {
                { "inDesignation_Id", objEmpDesg.DesignationId },
                { "inDesignation", objEmpDesg.Designation },
            };

            return(ExecuteDataSet("get_JobTitle", htparams));
        }
Exemple #3
0
        public DataSet GetDesigDetails(EmpDesignation objEmpDesg)
        {
            Hashtable htparams = new Hashtable
            {
                { "inDesignation_Id", objEmpDesg.DesignationId },
                { "inDepartment_Id", objEmpDesg.DepartmentId },
            };

            return(ExecuteDataSet("get_Designation", htparams));
        }
        public DataSet GetDesignationList(EmpDesignation objEmpDesgList)
        {
            Hashtable htparams = new Hashtable
            {
                { "@inDesignation_Id", objEmpDesgList.DesignationId },
                { "@inDepartment_Id", objEmpDesgList.DepartmentId },
                { "@inDesignation", objEmpDesgList.Designation },
                { "@inDepartmentdesc", objEmpDesgList.Departmentdesc },
                { "@inCompanyCode", objEmpDesgList.CompanyCode },
                { "@inRoleId", objEmpDesgList.RoleId },
                { "@inOp_Name", objEmpDesgList.Op_Name },
            };

            return(ExecuteDataSet("EmpDesignation", htparams));
        }
Exemple #5
0
        public int InsertEmpDesg(EmpDesignation objEmpDesg)
        {
            Hashtable htParams = new Hashtable
            {
                { "inDesignation_Id", objEmpDesg.DesignationId },
                { "inDepartment_Id", objEmpDesg.DepartmentId },
                { "inDesignation", objEmpDesg.Designation },
                { "inDepartmentdesc", objEmpDesg.Departmentdesc },
                { "inCompanyCode", objEmpDesg.CompanyCode },
                { "inRoleId", objEmpDesg.RoleId },
                { "inOp_Name", objEmpDesg.Op_Name },
            };

            return(ExecuteNonQuery("EmpDesignation", htParams));
        }
Exemple #6
0
 public ActionResult AddorEdit(EmpDesignation des)
 {
     if (ModelState.IsValid)
     {
         if (des.DG_ID == 0)
         {
             HttpResponseMessage response = GlobalVariables.webApiClient.PostAsJsonAsync("api/DESIGNATIONs", des).Result;
             TempData["SaveMessage"] = "Saved Successfully";
         }
         else
         {
             HttpResponseMessage response = GlobalVariables.webApiClient.PutAsJsonAsync("api/DESIGNATIONs/" + des.DG_ID.ToString(), des).Result;
             TempData["SaveMessage"] = "Updated Successfully";
         }
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Exemple #7
0
        public JsonResult UpdateDesignation(EmpDesignation designation)
        {
            CommonResponse cr = new CommonResponse();

            try
            {
                var pro = _context.EmpDesignation.Where(e => e.DesignationID == designation.DesignationID).FirstOrDefault();
                pro.DesignationName  = designation.DesignationName;
                pro.DesignationOrder = designation.DesignationOrder;
                pro.CategoryID       = designation.CategoryID;
                pro.UpdateDate       = DateTime.Now;
                pro.UpdateBy         = User.Identity.Name;
                pro.SetDate();
                _context.EmpDesignation.Update(pro);
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                cr.message = ex.Message;
                cr.results = Constant.FAILED;
            }
            return(new JsonResult(cr));
        }
Exemple #8
0
        public JsonResult AddDesignation([FromBody] EmpDesignation designation)
        {
            CommonResponse cr = new CommonResponse();

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