コード例 #1
0
        }//End

        #endregion



        /*
         * @author      :   AV <*****@*****.**>
         * @date        :   DEC. 15, 2016
         * @description :   addition of item details
         */
        #region UpdateItemsDetailsDraft
        public JsonResult UpdateItemsDetailsDraft()
        {
            try
            {
                var res          = new Dictionary <string, object>();
                var transDetails = new Details();

                transDetails.Id                = Convert.ToInt32(Request["AddedItem_ID"]);
                transDetails.HeaderCode        = Request["IdEdit"].ToString();
                transDetails.SessionId         = Session.SessionID;
                transDetails.Quantity          = Convert.ToDecimal(Request["QuantityEdit"].ToString());
                transDetails.UnitOfMeasureCode = Request["UnitOfMeasureCodeEdit"].ToString();
                transDetails.ItemCode          = Request["ItemCodeEdit"].ToString();
                transDetails.CategoryCode      = Request["CategoryCodeEdit"].ToString();
                transDetails.ItemTypeCode      = Request["ItemTypeCodeEdit"].ToString();
                transDetails.SerialNbr         = Request["SerialNbrEdit"].ToString();
                transDetails.TagNbr            = Request["TagNbrEdit"].ToString();
                transDetails.PONbr             = Request["PONbrEdit"].ToString();
                transDetails.IsActive          = true;
                transDetails.AddedBy           = Convert.ToInt32(Session["userId_local"]);
                transDetails.DateAdded         = DateTime.Now;
                transDetails.Remarks           = Request["RemarksEdit"].ToString();
                transDetails.Image             = Request["imageEdit"].ToString();
                string uploadDir = ConfigurationManager.AppSettings[ConfigurationManager.AppSettings["env"].ToString() + "_upload_images"].ToString();
                res = uploaderHelper.Uploader(Request.Files, uploadDir, Request.Browser.Browser.ToUpper());

                int ctr = draftsModel.IsItemAndSerialisExistToDrafted_GP(Request["IdEdit"].ToString(), Request["ItemCodeEdit"].ToString(), Request["SerialNbrEdit"].ToString(), transDetails.Id);


                if (ctr == 0)
                {
                    draftsModel.UpdateItemsDraft(transDetails);
                    response.Add(key: "success", value: true);
                    response.Add(key: "error", value: false);
                    response.Add(key: "message", value: " ");
                }
                else
                {
                    response.Add(key: "success", value: false);
                    response.Add(key: "error", value: true);
                    response.Add(key: "message", value: "");
                }

                // return Json(response, JsonRequestBehavior.AllowGet);
            }


            catch (Exception e)
            {
                response.Add(key: "success", value: false);
                response.Add(key: "error", value: true);
                response.Add(key: "message", value: e.ToString());
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }// End
コード例 #2
0
        public JsonResult TargetUpload()
        {
            //HttpContext.Server.ScriptTimeout = 300;
            Dictionary <string, object> res = new Dictionary <string, object>();

            //get upload directory from web config file
            string uploadDir = ConfigurationManager.AppSettings[ConfigurationManager.AppSettings["env"].ToString() + "_upload_target"].ToString();

            res = uploader_helper.Uploader(Request.Files, uploadDir, Request.Browser.Browser.ToUpper());
            foreach (string file in res["files"] as List <string> )
            {
                response = uploader_helper.UploadTargets(file);
            }
            return(Json(response, JsonRequestBehavior.AllowGet));
        }