Exemple #1
0
        public ActionResult Edit()
        {
            AL_Apply al = new AL_Apply();

            al.ID = Guid.NewGuid();
            return(View(al));
        }
Exemple #2
0
        public JsonResult EditPLeave(AL_Apply model)
        {
            string statuscode = "200";
            string msg        = "";

            //   model.StartDate = model.StartDate.Substring(0, 4) + model.StartDate.Substring(5, 2) + model.StartDate.Substring(8, 2);
            //  model.EndDate = model.EndDate.Substring(0, 4) + model.EndDate.Substring(5, 2) + model.EndDate.Substring(8, 2);

            if (ModelState.IsValid)
            {
                model.CreateTime    = DateTime.Now;
                model.XXID          = xxid;
                model.ApplicantID   = userid;
                model.ApplicantName = applayname;
                model.Status        = "未审核";
                model.CJR           = oabll.GetTypeName(Request["Type"]);
                model.CJRQ          = DateTime.Now.ToShortDateString();
                model.LastIP        = Request.UserHostAddress;
                // model.Hour = Convert.ToInt32(Request["Day"]) * 8;
                model.Hour = Convert.ToInt32(Convert.ToDouble(Request["Day"]) * 8);
                model.Memo = Request["Day"];
                var name = oabll.GetTeacherGH(new Guid(model.Approver1)).DisName;
                // model.Comment2 += "待" + name + "审核";
                // oabll.EditSend(model);
                try
                {
                    oabll.EditLeave(model);
                }
                catch (Exception ex)
                {
                    statuscode = "500";
                    msg        = ex.ToString();
                }
            }

            JsonResult rlt = new JsonResult {
                Data = new { statuscode, msg }
            };

            return(Json(rlt, JsonRequestBehavior.AllowGet));
        }