Пример #1
0
        public static bool Insert_DocumentType(DocumentCheckList model)
        {
            try
            {
                if (string.IsNullOrEmpty(model.DocChkListCode))
                {
                    strAutoCode = sysfun.GetNewMaxID("DocumentCheckList", "DocChkListCode", 5, model.DealerCode);
                }
                else
                {
                    strAutoCode = model.DocChkListCode;
                }


                SqlParameter[] param =
                {
                    new SqlParameter("@DealerCode", model.DealerCode),            //0
                    new SqlParameter("@DocChkListCode", strAutoCode),             //1
                    new SqlParameter("@DocChkListDesc", model.DocChkListDesc),    //2
                    new SqlParameter("@UpdUser", AuthBase.UserId),                //3
                    new SqlParameter("@UpdTerm", General.CurrentIP)               //4
                };
                dt = DataAccess.getDataTable("Sp_Insert_DocumentCheckList", param, General.GetBMSConString());
                if (dt.Rows.Count > 0)
                {
                }
                IsSaved = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(IsSaved);
        }
Пример #2
0
        public JsonResult Insert_DocumentType(DocumentCheckList objects)
        {
            bool result = false;

            string msg = "Failed to save record..";

            result = MasterMethods.Insert_DocumentType(objects);

            if (result)
            {
                msg = "Successfully Added";
            }

            return(Json(new { Success = result, Message = msg }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult AddImage_List(string data, string EnquiryId)
        {
            DocumentCheckList delchklist = new DocumentCheckList();
            string            json       = "";
            var Serializer = new JavaScriptSerializer();

            byte[] imageBytes = null;
            if (Request.Files.Count > 0)
            {
                HttpPostedFileBase file = Request.Files[0];

                if (file != null && file.ContentLength > 0)
                {
                    BinaryReader reader = new BinaryReader(file.InputStream);
                    imageBytes = reader.ReadBytes((int)file.ContentLength);
                    json       = "data:image/png;base64," + Convert.ToBase64String(imageBytes, 0, imageBytes.Length);
                    // json= "data:image/png;base64," + Convert.ToBase64String(file.Data, 0, file.Data.Length);
                }
            }

            return(Json(new { Success = true, Message = "", Response = json }, JsonRequestBehavior.AllowGet));
        }