Esempio n. 1
0
        public ActionResult FinsihProducts(int?id)
        {  // GET: Payment
            if (Session["LOGGEDIN"] != null)
            {
                LP_FinsihProduct_Property objPInvoiceVM = new LP_FinsihProduct_Property();
                LP_FinishProduct_BLL      objFPBLL      = new LP_FinishProduct_BLL();


                objPInvoiceVM.salesOrderLST = Helper.ConvertDataTable <LP_SalesOrder_Master_Property>(objFPBLL.SelectAll());

                objPInvoiceVM.ProductLST = Helper.ConvertDataTable <Product_Property>(ViewAllProducts());

                //objGRNVM_Property.Doc_No = "GRN-001";
                if (id > 0)
                {
                    //update
                    //objPIProperty = new LP_P_Invoice_Property();
                    //objPIProperty.idx = Convert.ToInt16(id);
                    //objPIBLL = new LP_PInvoice_BLL(objPIProperty);
                    //DataSet DS = objPIBLL.SelectByID();
                    //objPInvoiceVM.InvoiceProperty = Helper.ConvertDataTable<LP_P_Invoice_Property>(DS.Tables[0]);
                    //objPInvoiceVM.InvoiceDetails = Helper.ConvertDataTable<LP_P_Invoice_Details>(DS.Tables[1]);
                    //objPInvoiceVM.PITAXLIST = Helper.ConvertDataTable<LP_PI_Taxes_Property>(DS.Tables[2]);

                    ////
                    //objPInvoiceVM.ParentDocID = objPInvoiceVM.InvoiceProperty[0].ParentDocID;
                    //objPInvoiceVM.InvoiceNo = objPInvoiceVM.InvoiceProperty[0].InvoiceNo;
                    //objPInvoiceVM.VendorID = objPInvoiceVM.InvoiceProperty[0].VendorID;
                    //objPInvoiceVM.CreatedDate = objPInvoiceVM.InvoiceProperty[0].CreatedDate;
                    //objPInvoiceVM.Reference = objPInvoiceVM.InvoiceProperty[0].Reference;
                    //objPInvoiceVM.Description = objPInvoiceVM.InvoiceProperty[0].Description;
                    //objPInvoiceVM.NetAmount = objPInvoiceVM.InvoiceProperty[0].NetAmount;
                    //objPInvoiceVM.TotalAmount = objPInvoiceVM.InvoiceProperty[0].TotalAmount;
                    //objPInvoiceVM.TaxAmount = objPInvoiceVM.InvoiceProperty[0].TaxAmount;
                    //objPInvoiceVM.BalanceAmount = objPInvoiceVM.InvoiceProperty[0].BalanceAmount;
                    //objPInvoiceVM.PaidAmount = objPInvoiceVM.InvoiceProperty[0].PaidAmount;
                    //objPInvoiceVM.PaymentType = objPInvoiceVM.InvoiceProperty[0].PaymentType;
                    //objPInvoiceVM.bankIdx = objPInvoiceVM.InvoiceProperty[0].BankId;
                    //objPInvoiceVM.accorChequeNumber = objPInvoiceVM.InvoiceProperty[0].AccountChequeNo;
                    //ViewBag.update = true;

                    return(View("FinsihProducts", objPInvoiceVM));
                }
                else
                {
                    //objPInvoiceVM.InvoiceProperty = Helper.ConvertDataTable<LP_P_Invoice_Property>(new DataTable());
                    //objPInvoiceVM.InvoiceDetails = Helper.ConvertDataTable<LP_P_Invoice_Details>(new DataTable());
                    //objPInvoiceVM.PITAXLIST = Helper.ConvertDataTable<LP_PI_Taxes_Property>(new DataTable());
                    //LP_GenerateTransNumber_Property objtrans = new LP_GenerateTransNumber_Property();
                    //objtrans.TableName = "P_Invoice";
                    //objtrans.Identityfieldname = "idx";
                    //objtrans.userid = Session["UID"].ToString();
                    //objPInvoiceVM.InvoiceNo = objPIBLL.GeneratePINo(objtrans);
                    //objPInvoiceVM.CreatedDate =DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy"));
                    return(View("FinsihProducts", objPInvoiceVM));
                }
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }



            //LP_Activity_Property objActivityVM;
            //LP_Activity_BLL objVoucherBll;
            //LP_Voucher_Property objActivityMaster;
            //if (Session["LOGGEDIN"] != null)
            //{
            //    objActivityVM = new LP_Activity_Property();
            //    if (objActivityVM.idx > 0)
            //    {

            //    }
            //    else
            //    {
            //        LP_Activity_BLL objbll = new LP_Activity_BLL();

            //        objActivityVM.salesOrderLST = Helper.ConvertDataTable<LP_SalesOrder_Master_Property>(GetAllSalesInvoice());
            //        objActivityVM.vendorCatLST = Helper.ConvertDataTable<Vendor_Category_Property>(GetAllVendorsCategory());


            //    }

            //    return View("FinsihProducts", objActivityVM);
            //}
            //else
            //{
            //    return RedirectToAction("Login", "Account");
            //}
        }
        public ActionResult FinsihProducts(int?id)
        {  // GET: Finish Product
            string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
            string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
            string pagename       = @"/" + controllerName + @"/" + actionName;
            var    page           = (List <LP_Pages_Property>)Session["PageList"];

            if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page) && Session["ISADMIN"] != null && Convert.ToBoolean(Session["ISADMIN"].ToString()) == true)
            // if (Session["LOGGEDIN"] != null)

            {
                LP_FinsihProduct_Property objPInvoiceVM = new LP_FinsihProduct_Property();
                LP_FinishProduct_BLL      objFPBLL      = new LP_FinishProduct_BLL();


                objPInvoiceVM.salesOrderLST = Helper.ConvertDataTable <LP_SalesOrder_Master_Property>(objFPBLL.SelectAll());

                objPInvoiceVM.ProductLST = Helper.ConvertDataTable <Product_Property>(ViewAllProducts());

                //objGRNVM_Property.Doc_No = "GRN-001";
                if (id > 0)
                {
                    //update


                    return(View("FinsihProducts", objPInvoiceVM));
                }
                else
                {
                    return(View("FinsihProducts", objPInvoiceVM));
                }
            }
            else
            {
                if (Session["LoggedIn"] == null)
                {
                    return(RedirectToAction("Login", "Account"));
                }
                else
                {
                    return(RedirectToAction("NotAuthorized", "Account"));
                }
            }
        }