예제 #1
0
    private void showInv_ItemTransactionGrid()
    {
        int itemID = 0;

        List <Inv_ItemTransaction> Inv_ItemTransactionHostory = new List <Inv_ItemTransaction>();

        if (Request.QueryString["ItemID"] != null)
        {
            itemID = int.Parse(Request.QueryString["ItemID"]);
            Inv_ItemTransactionHostory = Inv_ItemTransactionManager.GetAllInv_ItemTransactionsByItemID(int.Parse(Request.QueryString["ItemID"]));
            //gvInv_ItemTransaction.DataSource = Inv_ItemTransactionHostory;
        }
        else if (Request.QueryString["ItemCode"] != null)
        {
            Inv_ItemTransactionHostory = Inv_ItemTransactionManager.GetAllInv_ItemTransactionsByItemCode(Request.QueryString["ItemCode"]);
            //gvInv_ItemTransaction.DataSource = Inv_ItemTransactionHostory;
            itemID = Inv_ItemTransactionHostory[0].ItemID;
        }
        Inv_ItemTransactionHostory       = assignWorkStationName(Inv_ItemTransactionHostory);
        gvInv_ItemTransaction.DataSource = Inv_ItemTransactionHostory;
        gvInv_ItemTransaction.DataBind();


        //item details
        List <Inv_Item> items = new List <Inv_Item>();

        items.Add(Inv_ItemManager.GetInv_ItemByID(itemID));

        gvInv_Item.DataSource = items;
        gvInv_Item.DataBind();

        hfItemID.Value = itemID.ToString();
    }
예제 #2
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Inv_ItemTransaction inv_ItemTransaction = new Inv_ItemTransaction();

        inv_ItemTransaction = Inv_ItemTransactionManager.GetInv_ItemTransactionByID(Int32.Parse(Request.QueryString["inv_ItemTransactionID"]));
        Inv_ItemTransaction tempInv_ItemTransaction = new Inv_ItemTransaction();

        tempInv_ItemTransaction.Inv_ItemTransactionID = inv_ItemTransaction.Inv_ItemTransactionID;

        tempInv_ItemTransaction.ItemID               = Int32.Parse(ddlItem.SelectedValue);
        tempInv_ItemTransaction.Quantity             = Decimal.Parse(txtQuantity.Text);
        tempInv_ItemTransaction.ItemTrasactionTypeID = Int32.Parse(ddlItemTrasactionType.SelectedValue);
        tempInv_ItemTransaction.ReferenceID          = Int32.Parse(ddlReference.SelectedValue);
        tempInv_ItemTransaction.ExtraField1          = txtExtraField1.Text;
        tempInv_ItemTransaction.ExtraField2          = txtExtraField2.Text;
        tempInv_ItemTransaction.ExtraField3          = txtExtraField3.Text;
        tempInv_ItemTransaction.ExtraField4          = txtExtraField4.Text;
        tempInv_ItemTransaction.ExtraField5          = txtExtraField5.Text;
        tempInv_ItemTransaction.AddedBy              = getLogin().LoginID;
        tempInv_ItemTransaction.AddedDate            = DateTime.Now;
        tempInv_ItemTransaction.UpdatedBy            = getLogin().LoginID;
        tempInv_ItemTransaction.UpdatedDate          = DateTime.Now;
        tempInv_ItemTransaction.RowStatusID          = 1;
        bool result = Inv_ItemTransactionManager.UpdateInv_ItemTransaction(tempInv_ItemTransaction);

        Response.Redirect("AdminInv_ItemTransactionDisplay.aspx");
    }
    protected void lbDelete_Click(object sender, EventArgs e)
    {
        LinkButton linkButton = new LinkButton();

        linkButton = (LinkButton)sender;
        bool result = Inv_ItemTransactionManager.DeleteInv_ItemTransaction(Convert.ToInt32(linkButton.CommandArgument));

        showInv_ItemTransactionGrid();
    }
    private void loadInv_ItemTransaction()
    {
        ListItem li = new ListItem("Select Inv_ItemTransaction...", "0");

        ddlInv_ItemTransaction.Items.Add(li);

        List <Inv_ItemTransaction> inv_ItemTransactions = new List <Inv_ItemTransaction>();

        inv_ItemTransactions = Inv_ItemTransactionManager.GetAllInv_ItemTransactions();
        foreach (Inv_ItemTransaction inv_ItemTransaction in inv_ItemTransactions)
        {
            ListItem item = new ListItem(inv_ItemTransaction.Inv_ItemTransactionName.ToString(), inv_ItemTransaction.Inv_ItemTransactionID.ToString());
            ddlInv_ItemTransaction.Items.Add(item);
        }
    }
예제 #5
0
    private void showInv_ItemTransactionData()
    {
        Inv_ItemTransaction inv_ItemTransaction = new Inv_ItemTransaction();

        inv_ItemTransaction = Inv_ItemTransactionManager.GetInv_ItemTransactionByID(Int32.Parse(Request.QueryString["inv_ItemTransactionID"]));

        ddlItem.SelectedValue = inv_ItemTransaction.ItemID.ToString();
        txtQuantity.Text      = inv_ItemTransaction.Quantity.ToString();
        ddlItemTrasactionType.SelectedValue = inv_ItemTransaction.ItemTrasactionTypeID.ToString();
        ddlReference.SelectedValue          = inv_ItemTransaction.ReferenceID.ToString();
        txtExtraField1.Text        = inv_ItemTransaction.ExtraField1;
        txtExtraField2.Text        = inv_ItemTransaction.ExtraField2;
        txtExtraField3.Text        = inv_ItemTransaction.ExtraField3;
        txtExtraField4.Text        = inv_ItemTransaction.ExtraField4;
        txtExtraField5.Text        = inv_ItemTransaction.ExtraField5;
        txtAddedBy.Text            = inv_ItemTransaction.AddedBy.ToString();
        txtUpdatedBy.Text          = inv_ItemTransaction.UpdatedBy.ToString();
        txtUpdatedDate.Text        = inv_ItemTransaction.UpdatedDate;
        ddlRowStatus.SelectedValue = inv_ItemTransaction.RowStatusID.ToString();
    }
예제 #6
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Inv_ItemTransaction inv_ItemTransaction = new Inv_ItemTransaction();

        inv_ItemTransaction.ItemID               = Int32.Parse(ddlItem.SelectedValue);
        inv_ItemTransaction.Quantity             = Decimal.Parse(txtQuantity.Text);
        inv_ItemTransaction.ItemTrasactionTypeID = Int32.Parse(ddlItemTrasactionType.SelectedValue);
        inv_ItemTransaction.ReferenceID          = Int32.Parse(ddlReference.SelectedValue);
        inv_ItemTransaction.ExtraField1          = txtExtraField1.Text;
        inv_ItemTransaction.ExtraField2          = txtExtraField2.Text;
        inv_ItemTransaction.ExtraField3          = txtExtraField3.Text;
        inv_ItemTransaction.ExtraField4          = txtExtraField4.Text;
        inv_ItemTransaction.ExtraField5          = txtExtraField5.Text;
        inv_ItemTransaction.AddedBy              = getLogin().LoginID;
        inv_ItemTransaction.AddedDate            = DateTime.Now;
        inv_ItemTransaction.UpdatedBy            = getLogin().LoginID;
        inv_ItemTransaction.UpdatedDate          = DateTime.Now;
        inv_ItemTransaction.RowStatusID          = 1;
        int resutl = Inv_ItemTransactionManager.InsertInv_ItemTransaction(inv_ItemTransaction);

        Response.Redirect("AdminInv_ItemTransactionDisplay.aspx");
    }
예제 #7
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        int purchaseReturnID = 0;
        Inv_PurchaseReturen inv_PurchaseReturen = new Inv_PurchaseReturen();

        inv_PurchaseReturen.PurchseReturenDate = DateTime.Parse(txtPurchaseReturnDate.Text);
        inv_PurchaseReturen.PurchaseIDs        = getPurchaseIDs(true);
        inv_PurchaseReturen.WorkSatationID     = 2;
        inv_PurchaseReturen.ExtraField1        = ddlSuppier.SelectedValue;
        inv_PurchaseReturen.ExtraField2        = txtNote.Text;
        inv_PurchaseReturen.ExtraField3        = "";
        inv_PurchaseReturen.ExtraField4        = "";
        inv_PurchaseReturen.ExtraField5        = "";
        inv_PurchaseReturen.AddedBy            = getLogin().LoginID;
        inv_PurchaseReturen.AddedDate          = DateTime.Now;
        inv_PurchaseReturen.UpdatedBy          = getLogin().LoginID;
        inv_PurchaseReturen.UpdatedDate        = DateTime.Now;
        inv_PurchaseReturen.RowStatusID        = 1;

        int purchaseAdjustmentID = 0;
        Inv_PurchaseAdjustment inv_PurchaseAdjustment = new Inv_PurchaseAdjustment();

        inv_PurchaseAdjustment.PurchseAdjustmentDate = DateTime.Parse(txtPurchaseReturnDate.Text);
        inv_PurchaseAdjustment.PurchaseIDs           = getPurchaseIDs(false);
        inv_PurchaseAdjustment.WorkSatationID        = 2;
        inv_PurchaseAdjustment.ExtraField1           = ddlSuppier.SelectedValue;
        inv_PurchaseAdjustment.ExtraField2           = txtNote.Text;
        inv_PurchaseAdjustment.ExtraField3           = "";
        inv_PurchaseAdjustment.ExtraField4           = "";
        inv_PurchaseAdjustment.ExtraField5           = "";
        inv_PurchaseAdjustment.AddedBy     = getLogin().LoginID;
        inv_PurchaseAdjustment.AddedDate   = DateTime.Now;
        inv_PurchaseAdjustment.UpdatedBy   = getLogin().LoginID;
        inv_PurchaseAdjustment.UpdatedDate = DateTime.Now;
        inv_PurchaseAdjustment.RowStatusID = 1;


        foreach (GridViewRow gvr in gvInv_Item.Rows)
        {
            HiddenField hfInv_ItemID          = (HiddenField)gvr.FindControl("hfInv_ItemID");
            Label       lblPurchaseID         = (Label)gvr.FindControl("lblPurchaseID");
            TextBox     txtReturnQuantity     = (TextBox)gvr.FindControl("txtReturnQuantity");
            TextBox     txtAdjustmentQuantity = (TextBox)gvr.FindControl("txtAdjustmentQuantity");

            if (txtReturnQuantity.Text != "0")
            {
                if (purchaseReturnID == 0)
                {
                    purchaseReturnID = Inv_PurchaseReturenManager.InsertInv_PurchaseReturen(inv_PurchaseReturen);
                }

                Inv_ItemTransaction inv_ItemTransaction = new Inv_ItemTransaction();

                inv_ItemTransaction.ItemID               = Int32.Parse(hfInv_ItemID.Value);
                inv_ItemTransaction.Quantity             = Decimal.Parse(txtReturnQuantity.Text);
                inv_ItemTransaction.ItemTrasactionTypeID = 1;//purchase return
                inv_ItemTransaction.ReferenceID          = purchaseReturnID;
                inv_ItemTransaction.ExtraField1          = "";
                inv_ItemTransaction.ExtraField2          = "";
                inv_ItemTransaction.ExtraField3          = "";
                inv_ItemTransaction.ExtraField4          = "";
                inv_ItemTransaction.ExtraField5          = "";
                inv_ItemTransaction.AddedBy              = getLogin().LoginID;
                inv_ItemTransaction.AddedDate            = DateTime.Now;
                inv_ItemTransaction.UpdatedBy            = getLogin().LoginID;
                inv_ItemTransaction.UpdatedDate          = DateTime.Parse(txtPurchaseReturnDate.Text);
                inv_ItemTransaction.RowStatusID          = 1;
                int resutl = Inv_ItemTransactionManager.InsertInv_ItemTransaction(inv_ItemTransaction);
            }

            if (txtAdjustmentQuantity.Text != "0")
            {
                if (purchaseAdjustmentID == 0)
                {
                    purchaseAdjustmentID = Inv_PurchaseAdjustmentManager.InsertInv_PurchaseAdjustment(inv_PurchaseAdjustment);
                }

                Inv_ItemTransaction inv_ItemTransaction = new Inv_ItemTransaction();

                inv_ItemTransaction.ItemID               = Int32.Parse(hfInv_ItemID.Value);
                inv_ItemTransaction.Quantity             = Decimal.Parse(txtAdjustmentQuantity.Text);
                inv_ItemTransaction.ItemTrasactionTypeID = 7;//Adjustment
                inv_ItemTransaction.ReferenceID          = purchaseAdjustmentID;
                inv_ItemTransaction.ExtraField1          = "";
                inv_ItemTransaction.ExtraField2          = "";
                inv_ItemTransaction.ExtraField3          = "";
                inv_ItemTransaction.ExtraField4          = "";
                inv_ItemTransaction.ExtraField5          = "";
                inv_ItemTransaction.AddedBy              = getLogin().LoginID;
                inv_ItemTransaction.AddedDate            = DateTime.Now;
                inv_ItemTransaction.UpdatedBy            = getLogin().LoginID;
                inv_ItemTransaction.UpdatedDate          = DateTime.Parse(txtPurchaseReturnDate.Text);
                inv_ItemTransaction.RowStatusID          = 1;
                int resutl = Inv_ItemTransactionManager.InsertInv_ItemTransaction(inv_ItemTransaction);
            }
        }

        if (purchaseReturnID != 0)
        {
            hlnkPurchasePrint.NavigateUrl = "PurchaseReturnPrint.aspx?ReturnID=" + purchaseReturnID.ToString();
            hlnkPurchasePrint.Visible     = true;
        }

        if (purchaseAdjustmentID != 0)
        {
            hlnkAdjustmentPrint.NavigateUrl = "AdjustmentPrint.aspx?AdjustmentID=" + purchaseAdjustmentID.ToString();
            hlnkAdjustmentPrint.Visible     = true;
        }


        showInv_IssueDetailGrid();
    }
 private void showInv_ItemTransactionGrid()
 {
     gvInv_ItemTransaction.DataSource = Inv_ItemTransactionManager.GetAllInv_ItemTransactions();
     gvInv_ItemTransaction.DataBind();
 }