Beispiel #1
0
        public ActionResult InputData(string site, string category, string location, string departement, string assetname, string supplier, string purchaseno,
                                      string brand, string purchasedateid, string model, string price, string serialno, string type, string company, string currency, string floor, string warranty,
                                      string cap, string active)
        {
            string userid = "system";
            //string Photo = GeneratePhoto(path);
            string hasil = string.Empty;

            dc = new DCAssetDataContext();
            try
            {
                var query = dc.MsAsset_IUD(assetname, brand, model, category, serialno, type, Convert.ToInt32(active), Convert.ToInt32(cap), "", site, location, Convert.ToInt32(floor),
                                           purchaseno, currency, Convert.ToDecimal(price), Convert.ToDateTime(purchasedateid), supplier, company, departement, Convert.ToInt32(warranty), userid, 1);
                foreach (var res in query)
                {
                    if (res.Status == "Err This Data Already Exists")
                    {
                        hasil = "Data Already Exists";
                    }
                    else
                    {
                        string qrcode = GenerateQrCode(res.Status);
                        var    qr     = dc.MsQrCode_IUD(res.Status, qrcode, userid, 1);
                        hasil = res.Status;
                    }
                }
            }
            catch (Exception ex)
            {
                return(Json(new { error = true, responseText = ex.Message.ToString().Trim() }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { success = true, responseText = hasil }, JsonRequestBehavior.AllowGet));
        }