Exemplo n.º 1
0
 public ActionResult CreateReclamation(string name, int statusID, string customerText, int haveWOW, int projectID, string reportDate)
 {
     var mng = new CRMManager();
     int y = Convert.ToInt32(reportDate.Substring(6));
     int m = Convert.ToInt32(reportDate.Substring(3, 2));
     int d = Convert.ToInt32(reportDate.Substring(0, 2));
     var item = new recl_items
     {
         id = 0,
         addedBy = User.Identity.Name,
         name = name,
         statusID = statusID,
         created = DateTime.Now.Date,
         haveWOW = haveWOW == 1 ? true : false,
         customerText = customerText,
         projectID = projectID,
         reportDate = new DateTime(y, m, d)
     };
     mng.SaveReclamation(item);
     return Json(new
     {
         result = item.id > 0,
         savedID = item.id,
     }, JsonRequestBehavior.AllowGet);
 }
        public ActionResult ReclamationsSaveItem(string addedBy, string name, /*string ord,*/ string projectName)
        {
            var res = false;

            try
            {
                var mng = new CRMManager();

                var item = new recl_items
                {
                    id        = 0,
                    created   = DateTime.Now,
                    addedBy   = addedBy != "" ? addedBy : null,
                    name      = name != "" ? name : null,
                    projectID = (int?)RDL.Convert.StrToInt(projectName, 0) != 0 ? (int?)RDL.Convert.StrToInt(projectName, 0) : null,
                };
                mng.SaveReclamation(item);
                res = true;
            }
            catch (Exception ex)
            {
                res = false;
            }
            return(Json(new
            {
                result = res,
                msg = ""
            }, JsonRequestBehavior.AllowGet));
        }