예제 #1
0
        //
        // GET: /Enquiry/Edit/5
        public ActionResult Edit(int id)
        {
            if (id != 0)
            {
                ClassMasterModel    objModel         = new ClassMasterModel();
                EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                objBDCCommon = new CommonMasterDataBusiness();

                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                objModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo  = objModel.ClassList;

                var EmployeeType = objBDCCommon.GetEmployeeMaster();
                objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                objBDC = new EnquiryDetailBusiness();
                var rs = objBDC.GetById(id);

                return(View(rs));
            }
            else
            {
                return(View());
            }
        }
예제 #2
0
        /// <summary>
        /// This method is used for get employee details with edution experince and ids data.
        /// Added by Jiya
        /// addedWehn 28 July 2019
        /// </summary>
        /// <param name="employeeMasterId"></param>
        /// <returns></returns>
        public EmployeeMasterModel GetEmployeeDetails(int employeeMasterId)
        {
            EmployeeMasterModel objEmployeeMasterModel = new EmployeeMasterModel();
            GEEDbContext        objGEEDbContext        = new GEEDbContext();
            var EmployeeData = objGEEDbContext.EmployeeMasters.Where(a => a.EmployeeMasterID == employeeMasterId).SingleOrDefault();

            objEmployeeMasterModel = Mapper.Map <EmployeeMasterModel>(EmployeeData);

            List <EmployeeEducationDetailModel> eduList = new List <EmployeeEducationDetailModel>();
            List <EmployeeExperienceModel>      expList = new List <EmployeeExperienceModel>();
            List <EmployeeIDdetailModel>        idList  = new List <EmployeeIDdetailModel>();
            var educationList = objGEEDbContext.EmployeeEducationDetails.Where(a => a.EmpCode == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item in educationList)
            {
                eduList.Add(Mapper.Map <EmployeeEducationDetailModel>(item));
            }
            var experinceList = objGEEDbContext.EmployeeExperiences.Where(a => a.EmpCode == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item2 in experinceList)
            {
                expList.Add(Mapper.Map <EmployeeExperienceModel>(item2));
            }

            var IdList = objGEEDbContext.EmployeeIDdetails.Where(a => a.EmpcodeID == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item3 in IdList)
            {
                idList.Add(Mapper.Map <EmployeeIDdetailModel>(item3));
            }
            objEmployeeMasterModel.EmployeeEducationDetailModelList = eduList;
            objEmployeeMasterModel.EmployeeExperienceModelList      = expList;
            objEmployeeMasterModel.EmployeeIDdetailModelList        = idList;
            return(objEmployeeMasterModel);
        }
예제 #3
0
        public async Task <JsonResult> Edit(EmployeeMasterModel collection)
        {
            try
            {
                //Demo-Implementing Permission
                //We aresending three parameter to check the permission
                //GroupID-This is coming from session object(collection)
                //Menu Code: From constants file MenuCodePermissionConstants.each action have its menu code.
                //PERMISSION: from constant file MenuCodePermissionConstants. each permission have name same as database permission name.
                bool isValid = await objCommoWebLib.IsValidPermission(Convert.ToInt32(collection.GroupID), MenuCodePermissionConstants.EMPLOYEE_MASTER_MENUCODE, MenuCodePermissionConstants.PERMISSION_UPDATE);

                if (isValid)
                {
                    collection.ModifiedDate = DateTime.Now;
                    var stringContent = new StringContent(JsonConvert.SerializeObject(collection).ToString(), Encoding.UTF8, "application/json");
                    var status        = await service.Update(stringContent);

                    return(new JsonResult {
                        Data = new { status = status, IsSaved = true, Message = "Successfully Saved." }
                    });
                }
                else
                {
                    return(new JsonResult {
                        Data = new { status = true, IsSaved = false, Message = "You don't have sufficient permission to this action." }
                    });
                }
            }
            catch (Exception ex)
            {
                return(new JsonResult {
                    Data = new { status = true, IsSaved = false, Message = "Error." }
                });
            }
        }
예제 #4
0
        public async Task <EmployeeMasterModel> SaveAsync(EmployeeMasterModel entity)
        {
            var empMaster = await _EmployeeMaster.SaveAsync(Mapper.Map <EmployeeMaster>(entity));

            return(new EmployeeMasterModel {
                EmployeeMasterID = empMaster.EmployeeMasterID
            });
        }
예제 #5
0
        public EmployeeMasterModel Save(EmployeeMasterModel entity)
        {
            var empMaster = _EmployeeMaster.Save(Mapper.Map <EmployeeMaster>(entity));

            return(new EmployeeMasterModel {
                EmployeeMasterID = empMaster.EmployeeMasterID
            });
        }
예제 #6
0
        /// <summary>
        /// This methoda is used for update is deleted column
        /// Added by Jiya
        /// addedWehn 28 July 2019
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        public int DeleteEmployeeDetails(EmployeeMasterModel entity)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          EmployeeData    = objGEEDbContext.EmployeeMasters.Where(a => a.EmployeeMasterID == entity.EmployeeMasterID).SingleOrDefault();

            EmployeeData.Modifiedby_ID = entity.ModifiedBy_ID;
            EmployeeData.ModifiedDate  = DateTime.Now;
            EmployeeData.IsDeleted     = true;
            objGEEDbContext.Entry(EmployeeData).State = System.Data.Entity.EntityState.Modified;
            return(objGEEDbContext.SaveChanges());
        }
예제 #7
0
        public ActionResult Edit(int id, EnquiryDetailCustomModel objModel)
        {
            try
            {
                // TODO: Add update logic here

                if (ModelState.IsValid)
                {
                    Response response = new Response();
                    // TODO: Add update logic here
                    objBDC              = new EnquiryDetailBusiness();
                    objModel.EnquiryId  = id;
                    objModel.CreatedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    objModel.ModifiedBy = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    response            = objBDC.SaveEnquiryDetails(objModel);

                    if (response.success == false)
                    {
                        return(new JavaScriptResult()
                        {
                            Script = "alert('Record already exists');"
                        });
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    ClassMasterModel    objClassModel    = new ClassMasterModel();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                    objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                    ViewBag.ClassInfo       = objClassModel.ClassList;

                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    objBDC = new EnquiryDetailBusiness();
                    var rs = objBDC.GetById(id);

                    return(View(rs));
                }
            }
            catch
            {
                return(View());
            }
        }
예제 #8
0
        private void tbxSave_Click(object sender, EventArgs e)
        {
            if (tbxName.Text.Equals(string.Empty))
            {
                MessageBox.Show("Name Can not Blank!");
            }
            EmployeeMasterModel objmodel = new EmployeeMasterModel();

            objmodel.EmployeeName    = tbxName.Text.Trim();
            objmodel.PrintName       = tbxPrintname.Text == ""?String.Empty:tbxPrintname.Text.Trim();
            objmodel.EmployeeCode    = Convert.ToInt32(tbxEmpCode.Text.Trim() == ""?"0":tbxEmpCode.Text.Trim());
            objmodel.Group           = cbxGroupname.SelectedItem.ToString();
            objmodel.Designation     = tbxDesignation.Text == "" ? String.Empty : tbxDesignation.Text.Trim();
            objmodel.FatherName      = tbxFname.Text.Trim() == "" ? String.Empty : tbxFname.Text.Trim();
            objmodel.SpouseName      = tbxSpousename.Text.Trim() == "" ? String.Empty : tbxSpousename.Text.Trim();
            objmodel.Address         = tbxAddress.Text.Trim() == "" ? String.Empty : tbxAddress.Text.Trim();
            objmodel.Address1        = tbxAddress1.Text.Trim() == "" ? String.Empty : tbxAddress1.Text.Trim();
            objmodel.Address2        = tbxAddress2.Text == "" ? String.Empty : tbxAddress2.Text.Trim();
            objmodel.Address3        = tbxAddress3.Text == "" ? String.Empty : tbxAddress3.Text.Trim();
            objmodel.DateofBirth     = Convert.ToDateTime(dtDob.Text.Trim() == "" ? String.Empty : dtDob.Text.Trim());
            objmodel.Gender          = cbxGender.Text.Trim();
            objmodel.MobileNumber    = Convert.ToInt32(tbxMobileno.Text.Trim() == ""?"0":tbxMobileno.Text.Trim());
            objmodel.TelephoneNumber = Convert.ToInt32(tbxPhone.Text.Trim() == ""?"0":tbxPhone.Text.Trim());
            objmodel.email           = tbxEmail.Text.Trim() == "" ? String.Empty : tbxEmail.Text.Trim();
            objmodel.ITpan           = tbxITpan.Text.Trim() == "" ? String.Empty : tbxITpan.Text.Trim();
            objmodel.DateofJoining   = Convert.ToDateTime(dtDoj.Text.Trim() == "" ? String.Empty : dtDoj.Text.Trim());
            objmodel.CurrentStatus   = tbxCurrentStatus.Text == "" ? String.Empty : tbxCurrentStatus.Text.Trim();
            objmodel.LastWorkingDate = Convert.ToDateTime(dtlwd.Text.Trim() == "" ? String.Empty : dtlwd.Text.Trim());
            objmodel.PFNo            = tbxPfno.Text == "" ? String.Empty : tbxPfno.Text.Trim();
            objmodel.ESIInsurance    = tbxEsino.Text == "" ? String.Empty : tbxEsino.Text.Trim();
            objmodel.BonusApplicable = tbxBonusapplicable.Text.Trim() == "" ? String.Empty : tbxBonusapplicable.Text.Trim();
            objmodel.EmailQuery      = tbxEmailQuery.Text == "" ? String.Empty : tbxEmailQuery.Text.Trim();
            objmodel.SMSQuery        = tbxSMSQuery.Text == "" ? String.Empty : tbxSMSQuery.Text.Trim();
            objmodel.Contactperson   = tbxContactPerson.Text == "" ? String.Empty : tbxContactPerson.Text.Trim();
            objmodel.Ward            = tbxWard.Text.Trim() == "" ? String.Empty : tbxWard.Text.Trim();
            objmodel.LSTNo           = tbxLstno.Text == "" ? String.Empty : tbxLstno.Text.Trim();
            objmodel.CSTNo           = tbxCstno.Text == "" ? String.Empty : tbxCstno.Text.Trim();
            objmodel.TIN             = tbxTin.Text == "" ? String.Empty : tbxTin.Text.Trim();
            objmodel.LBTNo           = tbxlbtno.Text == "" ? String.Empty : tbxlbtno.Text.Trim();
            objmodel.ServiceTaxNo    = tbxServicetax.Text == "" ? String.Empty : tbxServicetax.Text.Trim();
            objmodel.IECode          = tbxIecode.Text == "" ? String.Empty : tbxIecode.Text.Trim();
            objmodel.DLNo1           = tbxDlno1.Text == "" ? String.Empty : tbxDlno1.Text.Trim();
            objmodel.ChequePrintName = tbxChequePrintName.Text == "" ? String.Empty : tbxChequePrintName.Text.Trim();

            bool issaved = objempbl.SaveEmployeeMaster(objmodel);

            if (issaved)
            {
                MessageBox.Show("Saved Succsuffly!");
            }
        }
예제 #9
0
        public async Task <Tuple <bool, string> > UpdateEmployee(EmployeeMasterModel obj)
        {
            Tuple <bool, string> result = null;

            try
            {
                result = await _repo.UpdateEmployee(obj);
            }
            catch (Exception ex)
            {
                ErrorLog.Write(ex);
            }

            return(result);
        }
예제 #10
0
        public EmployeeMasterModel GetListofallEmployeesById(int id)
        {
            EmployeeMasterModel objemployees = new EmployeeMasterModel();

            string Query = "SELECT * FROM `employeemaster` WHERE Em_ID=" + id + "";

            System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(Query, _dbHelper.GetConnObject());

            while (dr.Read())
            {
                objemployees.EmployeeId      = Convert.ToInt32(dr["Em_ID"]);
                objemployees.EmployeeCode    = Convert.ToInt32(dr["EmployeeCode"].ToString() == "" ? "0" : dr["EmployeeCode"]);
                objemployees.EmployeeName    = dr["Name"].ToString();
                objemployees.PrintName       = dr["PrintName"].ToString();
                objemployees.Group           = dr["Group"].ToString();
                objemployees.Designation     = dr["Destination"].ToString();
                objemployees.FatherName      = dr["FatherName"].ToString();
                objemployees.SpouseName      = dr["SpouseName"].ToString();
                objemployees.Address         = dr["Address"].ToString();
                objemployees.DateofBirth     = Convert.ToDateTime(dr["DateofBirth"]);
                objemployees.Gender          = dr["Gender"].ToString();
                objemployees.MobileNumber    = Convert.ToInt32(dr["Mobile"].ToString() == ""?"0":dr["Mobile"].ToString());
                objemployees.TelephoneNumber = Convert.ToInt32(dr["Phone"].ToString() == "" ? "0" : dr["Phone"].ToString());
                objemployees.email           = dr["Email"].ToString() == ""?string.Empty:dr["Email"].ToString();
                objemployees.ITpan           = dr["ITPAN"].ToString() == "" ? string.Empty : dr["ITPAN"].ToString();
                objemployees.DateofJoining   = Convert.ToDateTime(dr["DateofJoin"]);
                objemployees.CurrentStatus   = dr["CurrentStatus"].ToString();
                objemployees.LastWorkingDate = Convert.ToDateTime(dr["LastworkingDate"]);
                objemployees.PFNo            = dr["PFNo"].ToString();
                objemployees.ESIInsurance    = dr["ESINo"].ToString();
                objemployees.BonusApplicable = dr["BonusApplication"].ToString();
                objemployees.EmailQuery      = dr["EmailQuery"].ToString();
                objemployees.SMSQuery        = dr["SMSQuery"].ToString();
                objemployees.Contactperson   = dr["ContactPerson"].ToString();
                objemployees.Ward            = dr["Ward"].ToString();
                objemployees.LSTNo           = dr["LSTNo."].ToString();
                objemployees.CSTNo           = dr["CSTNo"].ToString();
                objemployees.TIN             = dr["TIN"].ToString();
                objemployees.LBTNo           = dr["LBTNo"].ToString();
                objemployees.ServiceTaxNo    = dr["ServiceTaxNo"].ToString();
                objemployees.IECode          = dr["IECode"].ToString();
                objemployees.DLNo1           = dr["DLNo"].ToString();
                objemployees.ChequePrintName = dr["ChequePrintName"].ToString();
            }
            return(objemployees);
        }
예제 #11
0
        //
        // GET: /Enquiry/Create
        public ActionResult Create(int id = 0)
        {
            EnquiryDetailCustomModel objModel         = new EnquiryDetailCustomModel();
            ClassMasterModel         objClassModel    = new ClassMasterModel();
            SessionMasterModel       objSessionModel  = new SessionMasterModel();
            EmployeeMasterModel      objEmployeeModel = new EmployeeMasterModel();

            objBDCCommon = new CommonMasterDataBusiness();

            var SessionType = objBDCCommon.GetSessionMaster();

            objSessionModel.SessionList = new SelectList(SessionType, "SessionId", "Title");
            ViewBag.SessionInfo         = objSessionModel.SessionList;

            var EmployeeType = objBDCCommon.GetEmployeeMaster();

            objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
            ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

            if (id != 0)
            {
                objBDC   = new EnquiryDetailBusiness();
                objModel = objBDC.GetById(id);

                ViewBag.ClassValue   = Convert.ToString(objModel.ClassId);
                ViewBag.SessionValue = Convert.ToString(objModel.SessionId);

                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(objModel.SessionId));
                objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo       = objClassModel.ClassList;
            }
            else
            {
                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo       = objClassModel.ClassList;

                ViewBag.SessionValue = Session[CommonStrings.DefaultSession].ToString();
            }

            return(View(objModel));
        }
 public HttpResponseMessage Delete(EmployeeMasterModel data)
 {
     try
     {
         if (_employee.DeleteEmployeeDetails(data) > 0)
         {
             return(Request.CreateResponse(HttpStatusCode.OK, "Data Saved"));
         }
         else
         {
             Common.MyLogger.Error("data not saved return value is " + _employee.DeleteEmployeeDetails(data).ToString());
             return(Request.CreateResponse(HttpStatusCode.BadRequest, "Error"));
         }
     }
     catch (Exception ex)
     {
         Common.MyLogger.Error(ex.Message + ex.StackTrace + ex.InnerException.ToString());
         return(Request.CreateResponse(HttpStatusCode.BadRequest, "Error"));
     }
 }
예제 #13
0
        public async Task <ActionResult> Delete(int ID, int?groupId, int?sessionId, int?schoolId, int?deletedBy)
        {
            try
            {   //Demo-Implementing Permission
                //We aresending three parameter to check the permission
                //GroupID-This is coming from session object(collection)
                //Menu Code: From constants file MenuCodePermissionConstants.each action have its menu code.
                //PERMISSION: from constant file MenuCodePermissionConstants. each permission have name same as database permission name.

                EmployeeMasterModel collection = new EmployeeMasterModel();
                collection.EmployeeMasterID = ID;
                collection.Sessionyear      = sessionId;
                collection.GroupID          = groupId;
                collection.ModifiedBy_ID    = deletedBy;
                collection.SchoolID         = schoolId;
                bool isValid = await objCommoWebLib.IsValidPermission(Convert.ToInt32(collection.GroupID), MenuCodePermissionConstants.EMPLOYEE_MASTER_MENUCODE, MenuCodePermissionConstants.PERMISSION_DELETE);

                if (isValid)
                {
                    var stringContent = new StringContent(JsonConvert.SerializeObject(collection).ToString(), Encoding.UTF8, "application/json");
                    var status        = await service.Delete(stringContent);

                    return(new JsonResult {
                        Data = new { status = status, IsSaved = true, Message = "Successfully Deleted." }
                    });
                }
                else
                {
                    return(new JsonResult {
                        Data = new { status = true, IsSaved = false, Message = "You don't have sufficient permission to this action." }
                    });
                }
            }
            catch (Exception ex)
            {
                return(new JsonResult {
                    Data = new { status = false }
                });
            }
        }
        public async Task <Tuple <bool, string> > UpdateEmployee(EmployeeMasterModel obj)
        {
            Tuple <bool, string> result = null;
            int status = -1;

            try
            {
                var parameters = new DynamicParameters();
                using (SqlConnection cxn = new SqlConnection(_dcDb))
                {
                    parameters.Add("@ID", obj.ID, DbType.Int32);
                    parameters.Add("@RegIncentive", obj.RegIncentive, DbType.Decimal);
                    parameters.Add("@LoanRePayIncentive", obj.LoanRePayIncentive, DbType.Decimal);
                    parameters.Add("@RecruitementsReq", obj.RecruitmentsReq, DbType.Int32);
                    parameters.Add("@TargetJoineesPerMonth", obj.TargetJoineesPerMonth, DbType.Int32);
                    parameters.Add("@Salary", obj.Salary, DbType.Decimal);
                    parameters.Add("@Description", obj.Description, DbType.String);
                    parameters.Add("@CreatedBy", userID, DbType.Int32);

                    status = await cxn.ExecuteScalarAsync <int>("[dbo].[Update_EmployeeMaster]", parameters, commandType : CommandType.StoredProcedure);

                    if (status == 0)
                    {
                        result = Tuple.Create(true, "Employee details updated successfully.");
                    }
                    else
                    {
                        result = Tuple.Create(false, "There has been an error while updating Employee details.");
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Write(ex);
                result = Tuple.Create(false, "Oops! Employee details update failed.Please try again.");
            }

            return(result);
        }
예제 #15
0
        private void FillAccountInfo()
        {
            EmployeeMasterModel objemployees = objempbl.GetListofallEmployeesById(EmpMstId);

            //tbxName.Text=objemployees.EmployeeId]);
            //objemployees.EmployeeCode = Convert.ToInt32(dr["EmployeeCode"].ToString() == "" ? "0" : dr["EmployeeCode"]);
            tbxName.Text            = objemployees.EmployeeName;
            tbxPrintname.Text       = objemployees.PrintName;
            cbxGroupname.Text       = objemployees.Group;
            tbxDesignation.Text     = objemployees.Designation;
            tbxFname.Text           = objemployees.FatherName;
            tbxSpousename.Text      = objemployees.SpouseName;
            tbxAddress.Text         = objemployees.Address;
            dtDob.Text              = Convert.ToString(objemployees.DateofBirth);
            cbxGender.Text          = objemployees.Gender;
            tbxMobileno.Text        = Convert.ToString(objemployees.MobileNumber);
            tbxPhone.Text           = Convert.ToString(objemployees.TelephoneNumber);
            tbxEmail.Text           = objemployees.email;
            tbxITpan.Text           = objemployees.ITpan;
            dtDoj.Text              = Convert.ToString(objemployees.DateofJoining);
            tbxCurrentStatus.Text   = objemployees.CurrentStatus;
            dtlwd.Text              = Convert.ToString(objemployees.LastWorkingDate);
            tbxPfno.Text            = objemployees.PFNo;
            tbxEsino.Text           = objemployees.ESIInsurance;
            tbxBonusapplicable.Text = objemployees.BonusApplicable;
            tbxEmailQuery.Text      = objemployees.EmailQuery;
            //objemployees.SMSQuery = dr["SMSQuery"].ToString();
            //objemployees.Contactperson = dr["ContactPerson"].ToString();
            //objemployees.Ward = dr["Ward"].ToString();
            //objemployees.LSTNo = dr["LSTNo."].ToString();
            //objemployees.CSTNo = dr["CSTNo"].ToString();
            //objemployees.TIN = dr["TIN"].ToString();
            //objemployees.LBTNo = dr["LBTNo"].ToString();
            //objemployees.ServiceTaxNo = dr["ServiceTaxNo"].ToString();
            //objemployees.IECode = dr["IECode"].ToString();
            //objemployees.DLNo1 = dr["DLNo"].ToString();
            //objemployees.ChequePrintName = dr["ChequePrintName"].ToString();
        }
예제 #16
0
        // GET: FeeCollection/Create
        public ActionResult Create(int id = 0, int Aid = 0)
        {
            FeeCollectionCustomModel objFeeModel      = new FeeCollectionCustomModel();
            EnquiryDetailCustomModel objModel         = new EnquiryDetailCustomModel();
            EmployeeMasterModel      objEmployeeModel = new EmployeeMasterModel();

            objBDCCommon = new CommonMasterDataBusiness();
            objBDCENQ    = new EnquiryDetailBusiness();

            var EmployeeType = objBDCCommon.GetEmployeeMaster();

            objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
            ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

            StudentCommonDetail objRes = new StudentCommonDetail();

            var rs        = objBDCENQ.GetEnquiryId(Aid);
            int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
            int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
            int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

            if (Eid != 0)
            {
                ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                objBDC = new FeeCollectionBusiness();
                ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
            }

            if (id != 0)
            {
                objBDC      = new FeeCollectionBusiness();
                objFeeModel = objBDC.GetById(id);
            }

            return(View(objFeeModel));
        }
예제 #17
0
 public Task DeleteAsync(EmployeeMasterModel entity)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 public void Delete(EmployeeMasterModel entity)
 {
     throw new NotImplementedException();
 }
예제 #19
0
 public EmployeeMasterModel Update(EmployeeMasterModel entity)
 {
     throw new NotImplementedException();
 }
예제 #20
0
        public ActionResult Create(EnquiryDetailCustomModel objModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Response _Result = new Response();

                    if (Request.Files[MessageDisplay.int0].ContentLength > MessageDisplay.int0)
                    {
                        var path = Path.Combine(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + MessageDisplay.EnquiryFilePath);
                        objModel.Image = Thumbnails.UploadImage(Request.Files[MessageDisplay.int0].InputStream, path, Path.GetExtension(Request.Files[0].FileName), "e_", MessageDisplay.imageheightSize, MessageDisplay.imageweidthSize, false);
                    }

                    // TODO: Add insert logic here
                    objBDC              = new EnquiryDetailBusiness();
                    objModel.CreatedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    objModel.ModifiedBy = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    _Result             = objBDC.SaveEnquiryDetails(objModel);

                    if (_Result.success == true)
                    {
                        TempData["Message"] = "Success^" + _Result.message;
                    }
                    else if (_Result.success == false)
                    {
                        TempData["Message"] = "Error^" + _Result.message;
                    }

                    return(RedirectToAction("Index"));
                }
                else
                {
                    ClassMasterModel    objModelClass    = new ClassMasterModel();
                    SessionMasterModel  objSessionModel  = new SessionMasterModel();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                    objModelClass.ClassList = new SelectList(ClassType, "ClassId", "Title");
                    ViewBag.ClassInfo       = objModelClass.ClassList;

                    var SessionType = objBDCCommon.GetSessionMaster();
                    objSessionModel.SessionList = new SelectList(SessionType, "SessionId", "Title");
                    ViewBag.SessionInfo         = objSessionModel.SessionList;


                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    ViewBag.SessionValue = Session[CommonStrings.DefaultSession].ToString();

                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }
예제 #21
0
        /// <summary>
        /// Save Employee
        /// </summary>
        /// <param name="objEmpMaster"></param>
        /// <returns>True/False</returns>
        public bool SaveEmployeeMaster(EmployeeMasterModel objEmpMaster)
        {
            string Query = string.Empty;

            DBParameterCollection paramCollection = new DBParameterCollection();

            //paramCollection.Add(new DBParameter("@Acc_DbName", "SunSpped"));
            paramCollection.Add(new DBParameter("@Emp_NAME", objEmpMaster.EmployeeName));
            paramCollection.Add(new DBParameter("@Emp_CODE", objEmpMaster.EmployeeCode));
            paramCollection.Add(new DBParameter("@Emp_SHORTNAME", objEmpMaster.ShortName));
            paramCollection.Add(new DBParameter("@Emp_PRINTNAME", objEmpMaster.PrintName));
            paramCollection.Add(new DBParameter("@Emp_Group", objEmpMaster.Group));

            paramCollection.Add(new DBParameter("@Emp_Dest", objEmpMaster.Designation));
            paramCollection.Add(new DBParameter("@Emp_Fname", objEmpMaster.FatherName));
            paramCollection.Add(new DBParameter("@Emo_Sname", objEmpMaster.SpouseName));
            paramCollection.Add(new DBParameter("@Emp_address", objEmpMaster.Address));
            paramCollection.Add(new DBParameter("@Emp_address1", objEmpMaster.Address1));
            paramCollection.Add(new DBParameter("@Emp_address2", objEmpMaster.Address2));
            paramCollection.Add(new DBParameter("@Emp_Address3", objEmpMaster.Address3));
            paramCollection.Add(new DBParameter("@Emp_Dob", objEmpMaster.DateofBirth, System.Data.DbType.DateTime));
            paramCollection.Add(new DBParameter("@Emp_Gender", objEmpMaster.Gender));
            paramCollection.Add(new DBParameter("@Emp_MobileNumber", objEmpMaster.MobileNumber));
            paramCollection.Add(new DBParameter("@Emp_TelephoneNumber", objEmpMaster.TelephoneNumber));
            paramCollection.Add(new DBParameter("@Emp_email", objEmpMaster.email));
            paramCollection.Add(new DBParameter("@Emp_ITPanNumber", objEmpMaster.ITpan));
            paramCollection.Add(new DBParameter("@Emp_doj", objEmpMaster.DateofJoining, System.Data.DbType.DateTime));
            paramCollection.Add(new DBParameter("@Emp_curstatus", objEmpMaster.CurrentStatus));
            paramCollection.Add(new DBParameter("@Emp_lastdate", objEmpMaster.LastWorkingDate, System.Data.DbType.DateTime));
            paramCollection.Add(new DBParameter("@Emp_pf", objEmpMaster.PFNo));
            paramCollection.Add(new DBParameter("@Emp_esi", objEmpMaster.ESIInsurance));
            paramCollection.Add(new DBParameter("@Emp_Bonus", objEmpMaster.BonusApplicable));
            paramCollection.Add(new DBParameter("@Emp_emailquery", objEmpMaster.EmailQuery));
            paramCollection.Add(new DBParameter("@Emp_smsquery", objEmpMaster.SMSQuery));
            paramCollection.Add(new DBParameter("@Emp_conta", objEmpMaster.Contactperson));
            paramCollection.Add(new DBParameter("@Emp_ward", objEmpMaster.Ward));
            paramCollection.Add(new DBParameter("@Emp_lst", objEmpMaster.LSTNo));
            paramCollection.Add(new DBParameter("@Emp_cst", objEmpMaster.CSTNo));
            paramCollection.Add(new DBParameter("@Emp_tin", objEmpMaster.TIN));
            paramCollection.Add(new DBParameter("@Emp_lbt", objEmpMaster.LBTNo));
            paramCollection.Add(new DBParameter("@Emp_servicetax", objEmpMaster.ServiceTaxNo));
            paramCollection.Add(new DBParameter("@Emp_iecode", objEmpMaster.IECode));
            paramCollection.Add(new DBParameter("@Emp_dlno", objEmpMaster.DLNo1));
            paramCollection.Add(new DBParameter("@Emp_chPrintname", objEmpMaster.PrintName));



            Query =
                "INSERT INTO employeemaster (`EmployeeCode`,`Name`,`ShortName`,`PrintName`,`Group`,`Destination`,`FatherName`,`SpouseName`," +
                "`Address`,`Address1`,`Address2`,`Address3`,`DateofBirth`,`Gender`,`Mobile`," +
                "`Phone`,`Email`,`ITPAN`,`DateofJoin`,`CurrentStatus`,`LastworkingDate`,`PFNo`," +
                "`ESINo`,`BonusApplication`,`EmailQuery`,`SMSQuery`,`ContactPerson`,`Ward`,`LSTNo.`,`CSTNo`,`TIN`,`LBTNo`," +
                "`ServiceTaxNo`,`IECode`,`DLNo`,`ChequePrintName`)" +
                "VALUES(@Emp_CODE,@Emp_NAME,@Emp_SHORTNAME,@Emp_PRINTNAME,@Emp_Group,@Emp_Dest,@Emp_Fname,@Emo_Sname,@Emp_address," +
                "@Emp_address1,@Emp_address2,@Emp_address3,@Emp_Dob,@Emp_Gender,@Emp_MobileNumber," +
                "@Emp_TelephoneNumber,@Emp_email,@Emp_ITPanNumber,@Emp_doj,@Emp_curstatus,@Emp_lastdate,@Emp_pf," +
                "@Emp_esi,@Emp_Bonus,@Emp_emailquery,@Emp_smsquery,@Emp_conta,@Emp_ward,@Emp_lst,@Emp_cst,@Emp_tin,@Emp_lbt," +
                "@Emp_servicetax,@Emp_iecode,@Emp_dlno,@Emp_chPrintname)";



            return(_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0);
        }
예제 #22
0
        private void EmployeeFormData_Load()
        {
            SetMyControls();
            if (S1 == "&Add")
            {
                chkDailyWage.Checked = true;
                chkDailyWage.Checked = false;

                chkTeaBreak.Checked = true;
                chkTeaBreak.Checked = false;

                txtEmpName.Select();
                txtEmpCode.Text = ProjectFunctionsUtils.GetNewEmpCode();//.PadLeft(5, '0');
                form_loaded     = true;
            }
            if (S1 == "Edit")
            {
                RepList <EmployeeMasterModel> lista = new RepList <EmployeeMasterModel>();
                DynamicParameters             param = new DynamicParameters();
                param.Add("@EmpCode", EmpCode);

                EmployeeMasterModel empData = lista.returnClass_SP(SQL_QUERIES._frmEmployeeMstAddEdit.sp_LoadEmpMstFEditing(), param);


                //PrintLogWin.PrintLog("**************** =========> Line 120 => listData => " + listData.Count + "");
                if (empData != null)
                {
                    if (empData.EmpTeaTag == "Y")
                    {
                        chTeaTag.Checked = true;
                    }
                    else
                    {
                        chTeaTag.Checked = false;
                    }


                    txtEmpCode.Text     = empData.EmpCode;          // ds.Tables[0].Rows[0]["EmpCode"].ToString();
                    txtEmpName.Text     = empData.EmpName;
                    txtRelationTag.Text = empData.EmpFHRelationTag; //ds.Tables[0].Rows[0]["EmpFHRelationTag"].ToString();
                    txtFHName.Text      = empData.EmpFHName;        //ds.Tables[0].Rows[0]["EmpFHName"].ToString();
                    txtDeptCode.Text    = empData.EmpDeptCode;      //ds.Tables[0].Rows[0]["EmpDeptCode"].ToString();
                    txtDeptDesc.Text    = empData.DeptDesc;         //ds.Tables[0].Rows[0]["DeptDesc"].ToString();
                    txtDesgCode.Text    = empData.EmpDesgCode;      //ds.Tables[0].Rows[0]["EmpDesgCode"].ToString();
                    txtDesgDesc.Text    = empData.DesgDesc;         //ds.Tables[0].Rows[0]["DesgDesc"].ToString();

                    txtUnitCode.Text = empData.UnitCode;            //ds.Tables[0].Rows[0]["EmpDesgCode"].ToString();
                    txtUnitDesc.Text = empData.UnitName;            //ds.Tables[0].Rows[0]["DesgDesc"].ToString();

                    txtEmpSex.Text = empData.EmpSex;                //ds.Tables[0].Rows[0]["EmpSex"].ToString();
                    if (empData.EmpDOJ.ToString() == string.Empty)
                    {
                    }
                    else
                    {
                        txtDOJ.EditValue = Convert.ToDateTime(empData.EmpDOJ);
                    }
                    if (empData.EmpDOL.ToString() == string.Empty)
                    {
                    }
                    else
                    {
                        txtDOL.EditValue = Convert.ToDateTime(empData.EmpDOL);
                    }

                    txtEPFTag.Text  = empData.EmpPFDTag;            //ds.Tables[0].Rows[0]["EmpPFDTag"].ToString();
                    txtESIDTag.Text = empData.EmpESIDTag;           //ds.Tables[0].Rows[0]["EmpESIDTag"].ToString();
                    txtEPFNo.Text   = empData.EmpPFno;              //ds.Tables[0].Rows[0]["EmpPFno"].ToString();
                    txtESICNo.Text  = empData.EmpESIno;             //ds.Tables[0].Rows[0]["EmpESIno"].ToString();

                    txtTDS.Text        = empData.EmpTDS.ToString(); //ds.Tables[0].Rows[0]["EmpTDS"].ToString();
                    txtEmpLeft.Text    = empData.EmpLeft;           //ds.Tables[0].Rows[0]["EmpLeft"].ToString();
                    txtRemarks.Text    = empData.EmpRemarks;        //ds.Tables[0].Rows[0]["EmpRemarks"].ToString();
                    txtMotherName.Text = empData.EmpMotherNm;       //ds.Tables[0].Rows[0]["EmpMotherNm"].ToString();

                    txtState.Text = empData.EmpPerState;            //ds.Tables[0].Rows[0]["EmpPerState"].ToString();
                    txtState.Text = empData.EmpPerCountry;          //ds.Tables[0].Rows[0]["EmpPerCountry"].ToString();

                    txtNationality.Text  = empData.EmpNationality;  //ds.Tables[0].Rows[0]["EmpNationality"].ToString();
                    txtEmail.Text        = empData.EmpEmail;        //ds.Tables[0].Rows[0]["EmpEmail"].ToString();
                    txtCategoryCode.Text = empData.EmpCategory;     //ds.Tables[0].Rows[0]["EmpCategory"].ToString();

                    txtCategoryDesc.Text = empData.CatgDesc;        //ds.Tables[0].Rows[0]["CatgDesc"].ToString();

                    txtDOB.EditValue   = Convert.ToDateTime(empData.EmpDoB);
                    txtPanNo.Text      = empData.EmpPanNo;      //ds.Tables[0].Rows[0]["EmpPanNo"].ToString();
                    txtPassPortNo.Text = empData.EmpPassportNo; //ds.Tables[0].Rows[0]["EmpPassportNo"].ToString();


                    txtEmployeeReligion.Text = empData.EmpReligion;        //ds.Tables[0].Rows[0]["EmpReligion"].ToString();
                    txtMaritalStatus.Text    = empData.EmpMaritalStatus;   //ds.Tables[0].Rows[0]["EmpMaritalStatus"].ToString();
                    txtPaymentMode.Text      = empData.EmpPymtMode;        //ds.Tables[0].Rows[0]["EmpPymtMode"].ToString();
                    txtIfscCode.Text         = empData.EmpBankIFSCode;     //ds.Tables[0].Rows[0]["EmpBankIFSCode"].ToString();
                    txtBankAccountNo.Text    = empData.EmpBankAcNo;        //ds.Tables[0].Rows[0]["EmpBankAcNo"].ToString();
                    txtBankName.Text         = empData.EmpBankName;        //ds.Tables[0].Rows[0]["EmpBankName"].ToString();
                    txtNomineeName.Text      = empData.EmpNominee;         //ds.Tables[0].Rows[0]["EmpNominee"].ToString();
                    txtNomineeRelation.Text  = empData.EmpNomineeRelation; //ds.Tables[0].Rows[0]["EmpNomineeRelation"].ToString();
                    if (empData.EmpNomineeDOB.ToString() == string.Empty)
                    {
                    }
                    else
                    {
                        txtNomineeDOB.EditValue = Convert.ToDateTime(empData.EmpNomineeDOB);
                    }



                    txtAdharCardNo.Text = empData.EmpAdharCardNo;            //ds.Tables[0].Rows[0]["EmpAdharCardNo"].ToString();

                    txtHealthInsurance.Text = empData.EmpGHISDed.ToString(); //ds.Tables[0].Rows[0]["EmpGHISDed"].ToString();

                    txtMiscDed.Text = empData.EmpMscD1.ToString();           //ds.Tables[0].Rows[0]["EmpMscD1"].ToString();

                    txtAddress1.Text = empData.EmpAddress1;                  //ds.Tables[0].Rows[0]["EmpAddress1"].ToString();
                    txtAddress2.Text = empData.EmpAddress2;                  //ds.Tables[0].Rows[0]["EmpAddress2"].ToString();
                    txtAddress3.Text = empData.EmpAddress3;                  //ds.Tables[0].Rows[0]["EmpAddress3"].ToString();

                    txtState.Text   = empData.EmpState;                      //ds.Tables[0].Rows[0]["EmpState"].ToString();
                    txtCountry.Text = empData.EmpCountry;                    //ds.Tables[0].Rows[0]["EmpCountry"].ToString();

                    txtEFPFTag.Text = empData.EmpFpfDTag;                    //ds.Tables[0].Rows[0]["EmpFpfDTag"].ToString();

                    //NULL Exception
                    //txtUANNo.Text = ds.Tables[0].Rows[0]["EmpUANNo"].ToString();
                    //txtUnitCode.Text = ds.Tables[0].Rows[0]["UnitCode"].ToString();
                    //txtUnitName.Text = ds.Tables[0].Rows[0]["UnitName"].ToString();
                    //txtAccCode.Text = ds.Tables[0].Rows[0]["EmpPartyCode"].ToString();
                    //txtBankBranchCode.Text = ds.Tables[0].Rows[0]["EmpBankBranchCode"].ToString();
                    txtCategoryCode.Focus();

                    timeEdit_Time_In_First.EditValue  = empData.TimeInFirst.ToString();
                    timeEdit_Time_Out_First.EditValue = empData.TimeOutFirst.ToString();
                    timeEdit_Time_In_Last.EditValue   = empData.TimeInLast.ToString();
                    timeEdit_Time_Out_Last.EditValue  = empData.TimeOutLast.ToString();
                    totalWorkingHours_Text.EditValue  = empData.WorkingHours;
                    pictureBox1.Image = ConvertBinaryToImage(empData.EmpImage);

                    chkTeaBreak.Checked       = (empData.TeaBreak == 1) ? true : false;
                    txtTeaBreakTime.EditValue = empData.TeaBreakTime;
                    PrintLogWin.PrintLog("chkTeaBreak.Checked =========> " + chkTeaBreak.Checked + string.Empty);
                    PrintLogWin.PrintLog("empData.TeaBreak =========> " + empData.TeaBreak + string.Empty);

                    chkDailyWage.Checked = empData.DailyWage;
                    PrintLogWin.PrintLog("chkDailyWage.Checked =========> " + chkDailyWage.Checked + string.Empty);
                    PrintLogWin.PrintLog("empData.DailyWage =========> " + empData.DailyWage + string.Empty);

                    //DAILY WAGER//////////////////////////////
                    if (chkDailyWage.Checked)
                    {
                        if (empData.DailyWageRate != null && empData.DailyWageRate != 0)
                        {
                            txtDailyWageRate.EditValue = empData.DailyWageRate;
                            txtDailyWageRate.Tag       = empData.DailyWageRate;
                        }
                        else
                        {
                            txtDailyWageRate.EditValue = null;
                        }

                        if (empData.DailyWageMinutes != null && empData.DailyWageMinutes != 0)
                        {
                            txtDailyWageHours.EditValue = empData.DailyWageMinutes / 60;
                            txtDailyWageHours.Tag       = empData.DailyWageMinutes / 60;
                        }
                        else
                        {
                            txtDailyWageHours.EditValue = null;
                        }
                    }
                    else
                    {
                        txtDailyWageRate.Enabled   = false;
                        txtDailyWageRate.EditValue = null;

                        txtDailyWageHours.Enabled   = false;
                        txtDailyWageHours.EditValue = null;
                    }

                    //TEA BREAK//////////////////////////////
                    if (chkTeaBreak.Checked)
                    {
                        if (empData.TeaBreakTime != null && empData.TeaBreakTime != 0)
                        {
                            txtTeaBreakTime.EditValue = empData.TeaBreakTime;
                            txtTeaBreakTime.Tag       = empData.TeaBreakTime;
                        }
                        else
                        {
                            txtTeaBreakTime.EditValue = null;
                        }
                    }
                    else
                    {
                        txtTeaBreakTime.Enabled   = false;
                        txtTeaBreakTime.EditValue = null;
                    }
                }

                form_loaded = true;

                txtEmpName.Enabled = false;
                PrintLogWin.PrintLog("frmEmployeeMstAddEdit_Load =========> Line 131 => sp_LoadEmpMstFEditing '" + EmpCode + "'");
            }
        }
예제 #23
0
        public ActionResult Create(FeeCollectionCustomModel objModel, int Aid = 0)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    // TODO: Add insert logic here
                    objBDC    = new FeeCollectionBusiness();
                    objBDCENQ = new EnquiryDetailBusiness();
                    StudentCommonDetail objResult = new StudentCommonDetail();

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid > 0 && Aid > 0)
                    {
                        objModel.EnquiryId   = Eid;
                        objModel.AdmissionId = Aid;
                        objModel.ClassId     = ClassId;
                        objModel.SectionId   = SectionId;
                        objModel.CreatedBy   = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objModel.ModifiedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objBDC.SaveFeeCollectionMasterDetails(objModel);

                        return(RedirectToAction("Create", new { id = 0, AId = Aid }));
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    objBDCENQ = new EnquiryDetailBusiness();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid != 0)
                    {
                        ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                        objBDC = new FeeCollectionBusiness();
                        ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
                    }

                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }