Пример #1
0
        protected void btnSavePurchaseOrderDetails_Click(object sender, EventArgs e)
        {
            PurchaseOrderDetails Purd = new PurchaseOrderDetails();
            if (getQueryString_PurchaseOrderDetails > 0)
            {
                Purd.LoadByPrimaryKey(getQueryString_PurchaseOrderDetails);

            }
            else
            {
                Purd.AddNew();
                Purd.CreatedBy = new Guid(Membership.GetUser().ProviderUserKey.ToString());
                Purd.CreatedDate = DateTime.Now;
            }
            Purd.TotalValue = double.Parse(txtTotalValue.Text);
            Purd.UnitPrice = double.Parse(txtUnitPrice.Text);
            Purd.QuantityRequired = int.Parse(txtQuantityRequired.Text);
            Purd.StockOnHand = int.Parse(txtStockOnHands.Text);
            Purd.Unit = int.Parse(txtUnit.Text);
            Purd.Description = txtDescription.Text;
            Purd.PurchaseOrderID = getQueryString_PurchaseOrder;
            Purd.LastUpdatedDate = DateTime.Now;
            Purd.UpdatedBy = new Guid(Membership.GetUser().ProviderUserKey.ToString());
            Purd.Save();

            BindDetailsPurchaseOrder();
            cleardetails();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Master.PageTitle = "اوامر الشراء";

                BindGeneralPurchaseOrder();

                if (getQueryString_PurchaseOrder > 0)
                {
                    BLL.PurchaseOrder PoG = new BLL.PurchaseOrder();
                    PoG.LoadByPrimaryKey(getQueryString_PurchaseOrder);
                    txtPurchaseOrderNumber.Text = PoG.PurchaseOrderNumber;
                    txtPurchaseOrderDate.Text = PoG.PurchaseOrderDate.ToString("dd/MM/yyyy");
                    txtManagement.Text = PoG.Management;

                    //if(CheckBoxList1.Items.IndexOf(0)
                    //{

                    //}
                    txtDeliveryDate.Text = PoG.DeliveryDate.ToString("dd/MM/yyyy");
                    txtDeliveryPlace.Text = PoG.DeliveryPlace;
                    txtPaymentRequirement.Text = PoG.PaymentRequierment;
                    TxtManagerName.Text = PoG.ManagerName;
                    uiCheckBoxListType.Items[0].Selected = PoG.ISFinalProduct;
                    uiCheckBoxListType.Items[1].Selected = PoG.ISSample;
                    uiCheckBoxListType.Items[2].Selected = PoG.ISProductUnderManufacturing;
                    BindDetailsPurchaseOrder();

                    PanelPurchaseOrdersGrid.Visible = false;
                    PanelPurchaseOrderGeneral.Visible = true;
                    PanelGrdPurcahseOrderDetails.Visible = true;
                    PanelPurchaseOrderDetails.Visible = true;

                }
                if(getQueryString_PurchaseOrderDetails > 0)
                {
                    PurchaseOrderDetails POD = new PurchaseOrderDetails();
                    POD.LoadByPrimaryKey(getQueryString_PurchaseOrderDetails);
                    txtTotalValue.Text = POD.TotalValue.ToString();
                    txtUnitPrice.Text = POD.UnitPrice.ToString();
                    txtQuantityRequired.Text = POD.QuantityRequired.ToString();
                    txtStockOnHands.Text = POD.StockOnHand.ToString();
                    txtUnit.Text = POD.Unit.ToString();
                    txtDescription.Text = POD.Description;

                }

            }
            //BindGeneralPurchaseOrder();
            //BindDetailsPurchaseOrder();
        }
Пример #3
0
        protected void grdPurchaseOrderDetails_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "deleteDetailsOrder")
            {
                BLL.PurchaseOrderDetails Del = new BLL.PurchaseOrderDetails();

                Del.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
                Del.MarkAsDeleted();
                Del.Save();
                BindDetailsPurchaseOrder();

            }
            else if (e.CommandName == "editDetailsOrder")
            {
                int ID = int.Parse(e.CommandArgument.ToString());
                Response.Redirect(Request.Url.AbsolutePath.ToString() + "?PurchaseOrderID=" + Request.QueryString["PurchaseOrderID"].ToString() + "&PurchaseOrderDetailsID=" + ID.ToString());

            }
        }