Example #1
0
    protected void btnPostSupplyTransaction_Click(object sender, EventArgs e)
    {
        tblSupplyTableAdapter SupplyTableAdapter = new tblSupplyTableAdapter();
        int new_SupplyID = Convert.ToInt32(SupplyTableAdapter.InsertSupply(lblITSToWarehouse.Text, lblITSToLocation.Text, ddlToWarehouse.SelectedItem.Text, ddlToLocation.SelectedItem.Text, CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text), HttpContext.Current.User.Identity.Name));
        //Response.Write("new value :" + new_SupplyID);
        tblSupplyDetailsTableAdapter SupplyItemAdapter = new tblSupplyDetailsTableAdapter();

        foreach (GridViewRow RItem in gvSupplyTray.Rows)
        {
            GridViewRow thisGridViewRow = gvSupplyTray.Rows[RItem.RowIndex];
            HiddenField hfRDetailID     = (HiddenField)thisGridViewRow.FindControl("hfRDetailID");
            decimal     decRDetailID    = Convert.ToDecimal(hfRDetailID.Value);
            SupplyItemAdapter.InsertSupplyDetailsWithRequisition(new_SupplyID, decRDetailID, RItem.Cells[1].Text, Convert.ToDecimal(RItem.Cells[3].Text), RItem.Cells[6].Text.Trim());
            SupplyItemAdapter.spManageRequestStatus(decRDetailID, CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text));

            MapicsSupplyTransactions.WriteSupplyTransactions(RItem.Cells[6].Text.Trim(), RItem.Cells[1].Text.Trim(), RItem.Cells[2].Text.Trim(), lblITSToWarehouse.Text.Trim(), ddlToWarehouse.SelectedItem.Text.Trim(), Convert.ToDecimal(RItem.Cells[3].Text.Trim()), RItem.Cells[4].Text.Trim(), (RItem.Cells[10].Text.Trim() == " " ? " " : RItem.Cells[10].Text.Trim()), RItem.Cells[8].Text.Trim(), RItem.Cells[9].Text.Trim(), ddlToLocation.SelectedItem.Text.Trim(), CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text.Trim()), lblITSToLocation.Text.Trim(), HttpContext.Current.User.Identity.Name);
            //MapicsSupplyTransactions.WriteSupplyTransactions(RItem.Cells[6].Text.Trim(), RItem.Cells[1].Text.Trim(), RItem.Cells[2].Text.Trim(),lblITSToWarehouse.Text,ddlToWarehouse.SelectedItem.Text,Convert.ToDecimal(RItem.Cells[3].Text.Trim()),RItem.Cells[4].Text.Trim(),RItem.Cells[10].Text.Trim(),RItem.Cells[8].Text.Trim(),RItem.Cells[9].Text.Trim(),ddlToLocation.SelectedItem.Text,CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text), lblITSToLocation.Text,HttpContext.Current.User.Identity.Name);
        }
        // Show Message

        lblMessage.Text = "Supply Operation successful. Delivery Number: " + String.Format("{0:0000000}", new_SupplyID);
        // Set The View to next search and show the link for Delivery Note
        hlDeliveryNote.NavigateUrl             = String.Format("javascript:window.open('../../ERS/DeliveryNote.aspx?DlNo=" + new_SupplyID + "', null, 'height=500,width=650,status=yes,toolbar=no,menubar=no,location=no'); void('');");
        Response.Cookies["supplytray"].Expires = DateTime.Now;

        mvSupply.SetActiveView(vwSuccess);
    }
Example #2
0
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        tblSupplyTableAdapter SupplyTableAdapter = new tblSupplyTableAdapter();
        int new_SupplyID = Convert.ToInt32(SupplyTableAdapter.InsertSupply(ddlToWarehouse.SelectedItem.Text, ddlToLocation.SelectedItem.Text, ddlSupplyFromWarehouse.SelectedItem.Text, ddlSupplyFromLocation.SelectedItem.Text, CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text), HttpContext.Current.User.Identity.Name));
        //Response.Write("new value :" + new_SupplyID);
        tblSupplyDetailsTableAdapter SupplyItemAdapter = new tblSupplyDetailsTableAdapter();

        foreach (GridViewRow RItem in gvSupplyTray.Rows)
        {
            if (Convert.ToDecimal(RItem.Cells[3].Text) > 0)
            {
                SupplyItemAdapter.InsertSupplyDetailsWithoutRequisition(new_SupplyID, RItem.Cells[1].Text, Convert.ToDecimal(RItem.Cells[3].Text), RItem.Cells[6].Text.Trim());
                MapicsSupplyTransactions.WriteSupplyTransactions(RItem.Cells[6].Text.Trim(), RItem.Cells[1].Text.Trim(), RItem.Cells[2].Text.Trim(), ddlToWarehouse.SelectedItem.Text, ddlSupplyFromWarehouse.SelectedItem.Text, Convert.ToDecimal(RItem.Cells[3].Text.Trim()), RItem.Cells[4].Text.Trim(), (RItem.Cells[9].Text.Trim() == " " ? " " : RItem.Cells[9].Text.Trim()), RItem.Cells[7].Text.Trim(), RItem.Cells[8].Text.Trim(), ddlSupplyFromLocation.SelectedItem.Text, CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text), ddlToLocation.SelectedItem.Text.Trim(), HttpContext.Current.User.Identity.Name);
                //Response.Write(RItem.Cells[6].Text.Trim() +  " : " + RItem.Cells[1].Text.Trim() +  " : " + RItem.Cells[2].Text.Trim() +  " : " + ddlToWarehouse.SelectedItem.Text +  " : " + ddlSupplyFromWarehouse.SelectedItem.Text +  " : " + Convert.ToDecimal(RItem.Cells[3].Text.Trim()) +  " : " + RItem.Cells[4].Text.Trim() +  " : " + RItem.Cells[9].Text.Trim() +  " : " + RItem.Cells[7].Text.Trim() +  " : " + RItem.Cells[8].Text.Trim() +  " : " + ddlSupplyFromLocation.SelectedItem.Text +  " : " + CommonFunctions.ConvertToUniversalDate(txtTransactionDate.Text) +  " : " + ddlToLocation.SelectedItem.Text.Trim() +  " : " + HttpContext.Current.User.Identity.Name);
            }
        }
        // Show Message

        lblMessage.Text = "Supply Operation successful. Delivery Number: " + String.Format("{0:0000000}", new_SupplyID);
        // Set The View to next search and show the link for Delivery Note
        hlDeliveryNote.NavigateUrl = String.Format("javascript:window.open('../DeliveryNote.aspx?DlNo=" + new_SupplyID + "', null, 'height=500,width=650,status=yes,toolbar=no,menubar=no,location=no'); void('');");
        Response.Cookies["supplyWRtray"].Expires = DateTime.Now;
        mvSupplyWR.SetActiveView(vwSuccess);
    }