示例#1
0
        public ActionResult StatusSailor(int id)
        {
            int     notifType = Convert.ToInt32(Request["type"]);
            int     historyId = Convert.ToInt32(Request["historyId"]);
            DataSet ds        = cn.SailorDS(id);
            DataRow dr        = ds.Tables[0].Rows[0];

            sm.SailorId              = Convert.ToInt32(dr["SailorId"]);
            sm.SailorName            = dr["SailorName"].ToString();
            sm.BirthDate             = Convert.ToDateTime(dr["DateOfBirth"]);
            sm.MaritialStatus        = Convert.ToInt32(dr["MaritialStatus"]);
            sm.Address               = dr["Address"].ToString();
            sm.Height                = Convert.ToDouble(dr["Height"]);
            sm.Weight                = Convert.ToDouble(dr["Weight"]);
            sm.BloodType             = dr["BloodType"].ToString();
            sm.ShoeSize              = Convert.ToInt32(dr["ShoeSize"]);
            sm.JobStatus             = Convert.ToInt32(dr["JobStatus"]);
            sm.Password              = dr["Password"].ToString();
            sm.Type                  = 3.ToString();//Type:status change
            ViewBag.MaritialList     = JKLModel.getMaritialStatus();
            ViewBag.BloodTypeList    = JKLModel.getBloodType();
            ViewBag.notificationType = notifType;
            ViewBag.HistoryId1       = historyId;
            if (notifType == 1)
            {
                ViewBag.JobStatusList = JKLModel.getJobStatus(1);
            }
            if (notifType == 2)
            {
                ViewBag.JobStatusList = JKLModel.getJobStatus(2);
            }

            return(View("StatusSailor", sm));
        }
示例#2
0
 public ActionResult RegisterSailor()    // Calling when we first hit controller.
 {
     ViewBag.MaritialList  = JKLModel.getMaritialStatus();
     ViewBag.BloodTypeList = JKLModel.getBloodType();
     ViewBag.JobStatusList = JKLModel.getJobStatus();
     return(View());
 }
示例#3
0
 public ActionResult RegisterService()
 {
     ViewBag.SailorList = JKLModel.getSailor();
     ViewBag.RankList   = JKLModel.getRank();
     ViewBag.VesselList = JKLModel.getVessel(null);
     return(View());
 }
示例#4
0
 public ActionResult RegisterSailor(Sailor SM)
 {
     ViewBag.ErrorMessage  = cn.SailorAdd(SM);
     ViewBag.MaritialList  = JKLModel.getMaritialStatus();
     ViewBag.BloodTypeList = JKLModel.getBloodType();
     ViewBag.JobStatusList = JKLModel.getJobStatus();
     return(View());
 }
示例#5
0
 public ActionResult RegisterEmployee(ServiceModel SM) // Calling on http post (on Submit)
 {
     ViewBag.SailorList   = JKLModel.getSailor();
     ViewBag.RankList     = JKLModel.getRank();
     ViewBag.VesselList   = JKLModel.getVessel(null);
     ViewBag.ErrorMessage = cn.ServiceAdd(SM);
     cn.EmployeeDelete(SM.HistoryId);
     return(View("AddEmployee"));
 }
示例#6
0
 public ActionResult AddEmployee()
 {
     if (Session["Partner"] != null)
     {
         DataTable dt = (DataTable)Session["Partner"];
         int       Id = Convert.ToInt32(dt.Rows[0]["CompanyId"]);
         ViewBag.Company    = Id;
         ViewBag.VesselList = JKLModel.getVessel(Id);
     }
     ViewBag.RankList = JKLModel.getRank();
     return(View());
 }
示例#7
0
        public ActionResult RegisterEmployee()
        {
            int          empId     = Convert.ToInt32(Request["empId"]);
            int          companyId = Convert.ToInt32(Request["companyId"]);
            int          vesselId  = Convert.ToInt32(Request["vesselId"]);
            int          rankId    = Convert.ToInt32(Request["rankId"]);
            ServiceModel SM        = new ServiceModel();

            SM.HistoryId       = empId;
            SM.VesselId        = vesselId;
            SM.RankId          = rankId;
            ViewBag.SailorList = JKLModel.getSailor();
            ViewBag.RankList   = JKLModel.getRank();
            ViewBag.VesselList = JKLModel.getVessel(null);
            return(View("AddEmployee", SM));
        }
示例#8
0
        public ActionResult EditSailor(int id)
        {
            DataSet ds = cn.SailorDS(id);
            DataRow dr = ds.Tables[0].Rows[0];

            sm.SailorId           = Convert.ToInt32(dr["SailorId"]);
            sm.SailorName         = dr["SailorName"].ToString();
            sm.BirthDate          = Convert.ToDateTime(dr["DateOfBirth"]);
            sm.MaritialStatus     = Convert.ToInt32(dr["MaritialStatus"]);
            sm.Address            = dr["Address"].ToString();
            sm.Height             = Convert.ToDouble(dr["Height"]);
            sm.Weight             = Convert.ToDouble(dr["Weight"]);
            sm.BloodType          = dr["BloodType"].ToString();
            sm.ShoeSize           = Convert.ToInt32(dr["ShoeSize"]);
            sm.JobStatus          = Convert.ToInt32(dr["JobStatus"]);
            sm.Password           = dr["Password"].ToString();
            sm.Type               = 2.ToString();//edit Type
            ViewBag.MaritialList  = JKLModel.getMaritialStatus();
            ViewBag.BloodTypeList = JKLModel.getBloodType();
            ViewBag.JobStatusList = JKLModel.getJobStatus();
            return(View("RegisterSailor", sm));
        }
示例#9
0
 public ActionResult Notifications()
 {
     return(View(JKLModel.getNotifications()));
 }