コード例 #1
0
        public JsonResult AddUpdateConsigment(LP_Consigment_ViewModel objpurchase)
        {
            try
            {
                bool flag = false;


                _objconsigment                  = new LP_Consigment_Property();
                _objconsigment.InvoiceNo        = objpurchase.InvoiceNo;
                _objconsigment.ParentDocumentId = objpurchase.ParentDocumentId;
                //_objCIMaster.purchaseDate = objpurchase.purchaseDate;
                _objconsigment.Invoicedate = objpurchase.Invoicedate;
                _objconsigment.Reference   = objpurchase.Reference;
                //_objconsigment. = objpurchase.totalAmount;
                //_objconsigment.netAmount = objpurchase.netAmount;
                //_objconsigment.paidAmount = objpurchase.paidAmount;
                //_objconsigment.balanceAmount = objpurchase.balanceAmount;
                // _objCIMaster.DocumentNumber = objpurchase.DocumentNumber;
                // _objCIMaster.ContainerNo = objpurchase.ContainerNo;
                // _objCIMaster.ExchangeRate = objpurchase.ExchangeRate;
                // _objCIMaster.DepartmentID = objpurchase.DepartmentID;
                //  _objCIMaster.paidDate = ;// objpurchase.paidDate;
                _objconsigment.CIPODetails = Helper.ToDataTable <LP_CI_PurchaseDetails_Property>(objpurchase.CIDetailsPO);
                _objconsigment.DetailData  = Helper.ToDataTable <LP_ConsigmentDetails>(objpurchase.ConsigmentDetails);
                if (objpurchase.idx > 0)
                {
                    _objCIMaster.idx              = objpurchase.idx;
                    _objCIMaster.creationDate     = DateTime.Now;
                    _objCIMaster.visible          = 1;
                    _objCIMaster.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString());
                    _objCIMaster.visible          = 1;
                    _objCIMaster.status           = "0";
                    _objCIMaster.TableName        = "CommercialDetails";
                    objpurchaseBll = new LP_PI_BLL();
                    flag           = objpurchaseBll.Insert();
                    //update
                }
                else
                {
                    //add
                    _objconsigment.creationDate = DateTime.Now;
                    //_objconsigment.visible = 1;
                    _objconsigment.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString());
                    //_objconsigment.visible = 1;
                    _objconsigment.status    = 0;
                    _objconsigment.TableName = "consigmentdetails";
                    objpurchaseBll           = new LP_PI_BLL(_objconsigment);
                    flag = objpurchaseBll.InsertConsigment();
                }
                return(Json(new { data = "", success = flag, msg = flag == true ? "Successfull" : "Failed", statuscode = flag == true ? 200 : 401 }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #2
0
ファイル: LP_PI_BLL.cs プロジェクト: war-man/WajidPerception
 public LP_PI_BLL(LP_Consigment_Property objConsigment)
 {
     _objconsigment_Property = objConsigment;
 }