示例#1
0
 public ActionResult Edit([Bind(Include = "SerialNo,IdNo,FullName,EnglishFullName,Email,Podobi,Salary,Category,Department,JoiningDate,AccountNo,MainSalaryGrade,IncrementNo,Sex,IsFreedomFighter,IsAddiitonalDuties,IsStudentAdviser,IsDean,IsChairman,IsProvost,IsProctor,IsAssistantProctor,HasOwnTransportationMethod,IsTeacher")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         var grade = from a in db.Grades
                     where a.GradeRange.Equals(employee.MainSalaryGrade)
                     select a;
         Grade orDefault = grade.FirstOrDefault();
         if (orDefault != null)
         {
             int grad             = orDefault.GradeNo;
             int increment        = Int32.Parse(LanguageConverter.BanglaToEnglish(employee.IncrementNo));
             var mainsalaryString = from a in db.Taxes
                                    where a.Grade.Equals(grad) && a.Scale.Equals(increment)
                                    select a;
             var firstOrDefault = mainsalaryString.FirstOrDefault();
             if (firstOrDefault != null)
             {
                 employee.Salary = firstOrDefault.MainSalary;
             }
         }
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "SerialNo,DepartmentName")] Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(department));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "SerialNo,Data")] SalaryHis salaryHis)
 {
     if (ModelState.IsValid)
     {
         db.Entry(salaryHis).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(salaryHis));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "GradeNo,GradeRange")] Grade grade)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grade).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grade));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "SerialNo,DutyName,AllowanceAmount")] Allowance allowance)
 {
     if (ModelState.IsValid)
     {
         db.Entry(allowance).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(allowance));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "SerialNo,TitleName,Category")] Title title)
 {
     if (ModelState.IsValid)
     {
         db.Entry(title).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(title));
 }
示例#7
0
 public ActionResult Edit(
     [Bind(
          Include =
              "SerialNo,Name,Title,JoiningDate,MainSalary,PayableMainSalary,HouseRent,MedicalAllowance,CurriculumAssitanceAllowance,AssistantProctorAllowance,DeanORChairmanOrProvostAllowance,AdditionalDutiesOrStudentAdvisorAllowance,ResearchAllowance,TelephoneAllowance,Somonnoy,Total,GPF,BF,TransportationAllowance,IncomeTax,RevenueStamp,TotalSubtraction,NeatSalary"
          )] Salary salary)
 {
     if (ModelState.IsValid)
     {
         db.Entry(salary).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(salary));
 }