Esempio n. 1
0
 public ActionResult GetProductByDeclaration(decimal p_id)
 {
     try
     {
         Declaration_Info _info  = new Declaration_Info();
         Declaration_BL   _ObjBL = new Declaration_BL();
         _info = _ObjBL.DeclarationGetById(p_id);
         ViewBag.DecrationInfo = _info;
         return(PartialView("/Areas/ModuleDeclaration/Views/YShare/ProductDeclaration.cshtml"));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(null);
     }
 }
Esempio n. 2
0
 public ActionResult ViewApprove(decimal p_id)
 {
     try
     {
         Declaration_Info _info  = new Declaration_Info();
         Declaration_BL   _ObjBL = new Declaration_BL();
         _info = _ObjBL.DeclarationGetById(p_id);
         ViewBag.DecrationInfo = _info;
         ViewBag.IsApprove     = 1;
         return(PartialView("/Areas/ModuleDeclaration/Views/ExportWaiting/ViewDetails.cshtml"));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(null);
     }
 }
Esempio n. 3
0
 public ActionResult Edit()
 {
     try
     {
         string _url = Request.RawUrl;
         string _ok  = CommonFunc.Nvs_Redirect_QuyenTruyCapUser(_url);
         if (_ok != "")
         {
             return(Redirect(_ok));
         }
         decimal _Id  = 0;
         int     _tab = 1;
         if (RouteData.Values["id"] != null)
         {
             _Id = Convert.ToDecimal(RouteData.Values["id"]);
         }
         if (RouteData.Values["id1"] != null)
         {
             _tab = Convert.ToInt16(RouteData.Values["id1"].ToString());
         }
         Product_BL          _Product_BL = new Product_BL();
         List <Product_Info> _lst_data   = _Product_BL.Product_GetAll();
         ViewBag.ListProduct = _lst_data;
         ViewBag.CurrTab     = _tab;
         Declaration_Info _info  = new Declaration_Info();
         Declaration_BL   _ObjBL = new Declaration_BL();
         _info = _ObjBL.DeclarationGetById(_Id);
         ViewBag.DecrationInfo = _info;
         ViewBag.IsApprove     = 1;
         return(View(_info));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(null);
     }
 }
Esempio n. 4
0
        public ActionResult SaveDeralation(decimal Declaration_Refence_Id, string Declaration_Code,
                                           DateTime Register_Date, decimal Total_Value, string Gate, decimal Receive_Number,
                                           decimal Receive_Year, string Source, string Custom_Register,
                                           decimal Declaration_Type, string STR_LIST_PRODUCTS)
        {
            try
            {
                Declaration_BL   _objBL      = new Declaration_BL();
                Declaration_Info _Importinfo = _objBL.DeclarationGetById(Declaration_Refence_Id);
                Declaration_Info _ObjInfo    = new Declaration_Info();
                _ObjInfo.Declaration_Refence_Id   = Declaration_Refence_Id;
                _ObjInfo.Declaration_Refence_Code = _Importinfo.Declaration_Code;
                _ObjInfo.Declaration_Code         = Declaration_Code;
                _ObjInfo.Contract_Id        = _Importinfo.Contract_Id;
                _ObjInfo.Register_Date      = Register_Date;
                _ObjInfo.Contract_Code      = _Importinfo.Contract_Code;
                _ObjInfo.Total_Value        = Total_Value;
                _ObjInfo.WareHouse_Id       = _Importinfo.WareHouse_Id;
                _ObjInfo.WareHouse_Name     = _Importinfo.WareHouse_Name;
                _ObjInfo.WareHouse_Location = _Importinfo.WareHouse_Location;
                _ObjInfo.Gate             = Gate;
                _ObjInfo.Receive_Number   = Receive_Number;
                _ObjInfo.Receive_Year     = Receive_Year;
                _ObjInfo.Source           = Source; _ObjInfo.Custom_Register = Custom_Register;
                _ObjInfo.Declaration_Type = Declaration_Type;
                _ObjInfo.Status           = (decimal)NaviCommon.Enum_Contract_Status.ChoDuyet;
                _ObjInfo.Type             = (decimal)NaviCommon.Enum_Declaration_Type.ToKhai_Xuat;
                _ObjInfo.Created_Date     = NaviCommon.CommonFuc.CurrentDate();
                _ObjInfo.Created_By       = SessionData.CurrentUser.User_Name;
                STR_LIST_PRODUCTS         = STR_LIST_PRODUCTS.Trim().Trim('|');
                Product_Declaration_Info        _SubInfo     = new Product_Declaration_Info();
                List <Product_Declaration_Info> _ListProduct = new List <Product_Declaration_Info>();
                decimal _rel = 0;

                _rel = _objBL.Declaration_Insert(_ObjInfo);
                if (_rel > 0)
                {
                    string[] _strProduct = STR_LIST_PRODUCTS.Split('|');
                    foreach (var _str in _strProduct)
                    {
                        _SubInfo = new Product_Declaration_Info();
                        string[] _temp = _str.Split(',');
                        if (_temp.Length == 4)
                        {
                            _SubInfo.Declaration_Id           = _rel;
                            _SubInfo.Product_Id               = Convert.ToDecimal(_temp[0]);
                            _SubInfo.Package_Quantity         = Convert.ToDecimal(_temp[1]);
                            _SubInfo.Quantity                 = Convert.ToDecimal(_temp[2]);
                            _SubInfo.Value                    = Convert.ToDecimal(_temp[3]);
                            _SubInfo.Type                     = (decimal)NaviCommon.ProductDeralationType.Export;
                            _SubInfo.Declaration_Reference_Id = Declaration_Refence_Id;
                            _ListProduct.Add(_SubInfo);
                        }
                    }
                }
                Product_Declaration_BL _PrDBL = new Product_Declaration_BL();
                foreach (Product_Declaration_Info item in _ListProduct)
                {
                    if (_PrDBL.Product_Declaration_Insert(item) == false)
                    {
                        _rel = -1;
                        break;
                    }
                }
                return(Json(new { success = _rel }));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(Json(new { success = -1 }));
            }
        }