Ejemplo n.º 1
0
    private void showInv_IssueDetailGrid()
    {
        Inv_Utilization issueMaster = Inv_UtilizationManager.GetInv_UtilizationByID(int.Parse(Request.QueryString["UtilizationID"]));

        lblLastIssueID.Text = Request.QueryString["UtilizationID"];
        txtIssueDate.Text   = issueMaster.UtilizationDate.ToString("dd MMM yyyy");
    }
Ejemplo n.º 2
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Inv_Utilization inv_Utilization = new Inv_Utilization();

        inv_Utilization = Inv_UtilizationManager.GetInv_UtilizationByID(Int32.Parse(Request.QueryString["inv_UtilizationID"]));
        Inv_Utilization tempInv_Utilization = new Inv_Utilization();

        tempInv_Utilization.Inv_UtilizationID = inv_Utilization.Inv_UtilizationID;

        tempInv_Utilization.UtilizationDate = txtUtilizationDate.Text;
        tempInv_Utilization.IssueIDs        = Int32.Parse(ddlIssue.SelectedValue);
        tempInv_Utilization.WorkSatationID  = Int32.Parse(ddlWorkSatation.SelectedValue);
        tempInv_Utilization.ExtraField1     = txtExtraField1.Text;
        tempInv_Utilization.ExtraField2     = txtExtraField2.Text;
        tempInv_Utilization.ExtraField3     = txtExtraField3.Text;
        tempInv_Utilization.ExtraField4     = txtExtraField4.Text;
        tempInv_Utilization.ExtraField5     = txtExtraField5.Text;
        tempInv_Utilization.AddedBy         = Int32.Parse(txtAddedBy.Text);
        tempInv_Utilization.AddedDate       = DateTime.Now;
        tempInv_Utilization.UpdatedBy       = Int32.Parse(txtUpdatedBy.Text);
        tempInv_Utilization.UpdatedDate     = txtUpdatedDate.Text;
        tempInv_Utilization.RowStatusID     = Int32.Parse(ddlRowStatus.SelectedValue);
        bool result = Inv_UtilizationManager.UpdateInv_Utilization(tempInv_Utilization);

        Response.Redirect("AdminInv_UtilizationDisplay.aspx");
    }
Ejemplo n.º 3
0
    private void showInv_UtilizationData()
    {
        Inv_Utilization inv_Utilization = new Inv_Utilization();

        inv_Utilization = Inv_UtilizationManager.GetInv_UtilizationByID(Int32.Parse(Request.QueryString["inv_UtilizationID"]));

        txtUtilizationDate.Text       = inv_Utilization.UtilizationDate;
        ddlIssue.SelectedValue        = inv_Utilization.IssueIDs.ToString();
        ddlWorkSatation.SelectedValue = inv_Utilization.WorkSatationID.ToString();
        txtExtraField1.Text           = inv_Utilization.ExtraField1;
        txtExtraField2.Text           = inv_Utilization.ExtraField2;
        txtExtraField3.Text           = inv_Utilization.ExtraField3;
        txtExtraField4.Text           = inv_Utilization.ExtraField4;
        txtExtraField5.Text           = inv_Utilization.ExtraField5;
        txtAddedBy.Text            = inv_Utilization.AddedBy.ToString();
        txtUpdatedBy.Text          = inv_Utilization.UpdatedBy.ToString();
        txtUpdatedDate.Text        = inv_Utilization.UpdatedDate;
        ddlRowStatus.SelectedValue = inv_Utilization.RowStatusID.ToString();
    }
Ejemplo n.º 4
0
    private void loadData()
    {
        int             adjustmentID       = int.Parse(Request.QueryString["UtilizationID"]);
        Inv_Utilization purchaseAdjustment = Inv_UtilizationManager.GetInv_UtilizationByID(adjustmentID);

        //purchase info
        lblPurchaseDate.Text     = purchaseAdjustment.UtilizationDate.ToString("dd-MMM-yyyy");
        lblPurchaseReturnID.Text = purchaseAdjustment.Inv_UtilizationID.ToString();
        //lblRefPurchaseNo.Text = purchaseAdjustment.PurchaseIDs;
        //lblSupplierName.Text = purchaseAdjustment.ExtraField1;
        lblParticulars.Text = purchaseAdjustment.ExtraField2;

        //Item Info
        List <Inv_Item> items = new List <Inv_Item>();

        items = Inv_ItemManager.GetAllInv_ItemsByUtilizationID(adjustmentID);

        string  htmlTable         = @" <table id='itemList_tbl' style='border:1px solid black;width:100%;' cellpadding='0' cellspacing='0'>
                        <tr id='tableHeader'>
                            <td  style='border-left:0px;'>S/L</td>
                            <td>Product Code</td>
                            <td>Product Name</td>
                            <td>Quantity</td>
                            <td>Unit</td>
                            <td>Price</td>
                            <td>Amount</td>
                            <td>Apx Qty</td>
                            <td>Prod Qty</td>
                        </tr>";
        int     lastRawMaterialID = 0;
        decimal Total             = 0;
        decimal Subtotal          = 0;
        decimal TotalAmount       = 0;
        decimal SubtotalAmount    = 0;

        decimal approximateQuantityTotal    = 0;
        decimal approximateQuantitySubTotla = 0;
        decimal ProductionQuantityTotal     = 0;
        decimal ProductionQuantitySubTotla  = 0;

        int serialNo = 1;

        foreach (Inv_Item item in items)
        {
            if (lastRawMaterialID != 0 && lastRawMaterialID != item.RawMaterialID)
            {
                htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                            <td>" + approximateQuantitySubTotla.ToString("0,0.00") + @"</td>
                            <td>" + ProductionQuantitySubTotla.ToString("0,0.00") + @"</td>
                        </tr>";

                Subtotal       = 0;
                SubtotalAmount = 0;
                approximateQuantitySubTotla = 0;
                ProductionQuantitySubTotla  = 0;
            }

            if (lastRawMaterialID != item.RawMaterialID)
            {
                lastRawMaterialID = item.RawMaterialID;
                htmlTable        += @"<tr>
                            <td colspan='9' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;font-weight:bold;'>
                                Item: " + item.RawMaterialName + @"
                            </td>
                        </tr>";
            }

            htmlTable += @"<tr class='itemCss'>
                            <td  style='border-left:0px;'>" + (serialNo++).ToString() + @"</td>
                            <td>" + item.ItemCode + @"</td>
                            <td>" + item.ItemName + @"</td>
                            <td style='text-align:right;'>" + item.PurchasedQuantity.ToString("0,0.00") + @"</td>
                            <td >" + item.QuantityUnitName + @"</td>
                            <td style='text-align:right;'>" + item.PricePerUnit.ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + item.PurchasedQuantityPrice.ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(item.ExtraField4).ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(item.ExtraField3).ToString("0,0.00") + @"</td>
                        </tr>";

            Subtotal       += item.PurchasedQuantity;
            SubtotalAmount += item.PurchasedQuantityPrice;

            Total       += item.PurchasedQuantity;
            TotalAmount += item.PurchasedQuantityPrice;



            approximateQuantitySubTotla += decimal.Parse(item.ExtraField4);
            ProductionQuantitySubTotla  += decimal.Parse(item.ExtraField3);

            approximateQuantityTotal += decimal.Parse(item.ExtraField4);
            ProductionQuantityTotal  += decimal.Parse(item.ExtraField3);
        }

        htmlTable += @"<tr class='subtotalRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Sub Total</td>
                        <td>" + Subtotal.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                            <td>" + approximateQuantitySubTotla.ToString("0,0.00") + @"</td>
                            <td>" + ProductionQuantitySubTotla.ToString("0,0.00") + @"</td>
                    </tr>";

        htmlTable += @"<tr id='lastRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Grand Total</td>
                        <td>" + Total.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + TotalAmount.ToString("0,0.00") + @"</td>
                        <td>" + approximateQuantityTotal.ToString("0,0.00") + @"</td>
                        <td>" + ProductionQuantityTotal.ToString("0,0.00") + @"</td>
                    </tr></table>";

        lblItemList.Text = htmlTable;
    }