Ejemplo n.º 1
0
        public ActionResult EmployeeSetup(int empCode = 0)
        {
            //CRM.Models.clsSubmitModel oSubmit = new CRM.Models.clsSubmitModel();
            EmployeeSetup frm = new EmployeeSetup();

            var vwDept = from a in db.studdets where a.studType == 11 orderby a.studName select new { itgpName = a.studName, itgpcode = a.studCode };

            ViewBag.mstDept = new SelectList(vwDept, "itgpcode", "itgpName");

            var vwDesi = from a in db.studdets where a.studType == 1233 orderby a.studName select new { itgpName = a.studName, itgpcode = a.studCode };

            ViewBag.iEAcc_empodesg = new SelectList(vwDesi, "itgpcode", "itgpName");

            var vwState = from a in db.citydets where a.cityType == 67 && a.cityrute == 3 select new { a.citycode, a.cityname };

            ViewBag.vwState = new SelectList(vwState, "citycode", "cityname");

            ViewBag.vwBank = new SelectList(from a in db.studdets where a.studType == 163 select new { a.studCode, a.studName }, "studCode", "studName");

            if (empCode > 0)
            {
                frm = oSubmit.GetEmployeeDet("select empCode iEmp_empcode , empname sEmp_empname,  PAN sEmp_PAN,  Gender iEmp_Gender,  ProofNo sEmp_ProofNo,  AcNo sEmp_AcNo, Official_No sOfficial_No,Residential_No sResidential_No,ReferenceNm sReferenceNm , ReferenceNo sReferenceNo,FatherNo sFatherNo, TemporaryAdd sTemporaryAdd, PermanentAdd sPermanentAdd,EmailID sEmailID ,BirthDt dEAcc_BirthDt ,Father ,Aadhar ,IFSC ,DegreeNM ,DegreeID ,empcity iEmp_empcity ,empStat sEmp_empstat ,BloodGroup sBloodGroup ,PfAcNo ,BankID ,empDepa mstDept,empDesi iEAcc_empodesg , IMG_Path sPath, IMG_Path  ,AadharCard , VoterId , Licence , Passport , Statement , Degree  from employee where empcode =  " + empCode);

                if (frm.IMG_Path != null && frm.IMG_Path.ToString() != "")
                {
                    ViewBag.vbImgPath = frm.IMG_Path;
                }
                else
                {
                    ViewBag.vbImgPath = "../../img/avatar.png";
                }

                frm.dEAcc_BirthDts = Convert.ToDateTime(frm.dEAcc_BirthDt).ToString("dd/MM/yyyy");
                frm.isEdit         = true;
            }
            else
            {
                DataTable dt;
                dt = oSubmit.GetData("select isnull(max(empcode),0)+1 empcode from employee", true);
                frm.iEmp_empcode  = Convert.ToInt32(dt.Rows[0]["empcode"]);
                ViewBag.vbImgPath = "../../img/avatar.png";
                frm.isEdit        = false;
            }

            //frm.lstEmployeeSetup = oSubmit.EmployeeList("select empCode iEmp_empcode , empname sEmp_empname,  PAN sEmp_PAN,  Gender iEmp_Gender,  ProofNo sEmp_ProofNo,  AcNo sEmp_AcNo, Official_No sOfficial_No,Residential_No sResidential_No,ReferenceNm sReferenceNm , ReferenceNo sReferenceNo,FatherNo sFatherNo, TemporaryAdd sTemporaryAdd, PermanentAdd sPermanentAdd,EmailID sEmailID from employee");

            return(PartialView(frm));
        }