protected void btnRun_Click(object sender, EventArgs e)
    {
        if (!WebTools.UserInRole("MM_UPDATE"))
        {
            Master.ShowWarn("Access Denied!");
            return;
        }
        decimal return_val;
        string  message = string.Empty;

        //cutting plan is available?
        return_val = WebTools.DMax("ISSUE_ID", "PIP_WORK_ORD_CUTLEN", " WHERE ISSUE_ID=" + Request.QueryString["ISSUE_ID"]);
        if (return_val > 0)
        {
            message = "Cutting plan already calculated!";
        }

        //remain pipe used?
        return_val = WebTools.DMax("REM_FROM", "VIEW_TOTAL_PIPE_REM", " WHERE USED_QTY>0 AND REM_FROM=" + Request.QueryString["ISSUE_ID"]);
        if (return_val > 0)
        {
            Master.ShowWarn("This job card remains already used in other job cards!");
            return;
        }

        modeField.Value = "1";
        btnYes.Visible  = true;
        btnNo.Visible   = true;
        Master.ShowWarn(message + "PROCEED RUN THE CUT-LENGHT CALCULATION?");
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Master.HeadingMessage  = "Quarantine Details";
         Master.HeadingMessage += "<br/>";
         Master.HeadingMessage += WebTools.GetExpr("QRNTINE_NO", "PIP_QUARANTINE", " WHERE QRNTINE_ID='" + Request.QueryString["id"].ToString() + "'");
         decimal qr_item = WebTools.DMax("QR_ITEM", "PIP_MAT_QUARANTINE", " WHERE QRNTINE_ID='" + Request.QueryString["id"] + "'");
         txtQritem.Text = (qr_item + 1).ToString();
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string heading = "Add Items (";
            heading += WebTools.GetExpr("MIR_NO", "PRC_MAT_INSP", " MIR_ID='" + Session["popUp_MIR_ID"].ToString() + "'") + ")";
            Master.HeadingMessage(heading);
        }
        decimal mir_item_no = WebTools.DMax("MIR_ITEM_NUM", "VIEW_ADAPTER_MIR_DT", " WHERE MIR_ID='" + Session["popUp_MIR_ID"].ToString() + "'");

        txtMIRItemNo.Text = (mir_item_no + 1).ToString();
    }
    private void NextLotNo()
    {
        if (ddWelderNos.SelectedValue.ToString() == "-1")
        {
            txtLotNo.Text = string.Empty;
            return;
        }
        string LOT_NO = Convert.ToString(
            WebTools.DMax("LOT_NO", "PIP_WELDER_LOT", " WHERE WELDER_ID=" + ddWelderNos.SelectedValue.ToString()) + 1);

        txtLotNo.Text = LOT_NO;
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string uname    = Session["USER_NAME"].ToString();
         string po_id    = WebTools.GetExpr("PO_ID", "PIP_PO_BATCH_PLAN", " WHERE BATCH_ID='" + Request.QueryString["BATCH_ID"] + "'");
         string po_no    = WebTools.GetExpr("PO_NO", "PIP_PO", " WHERE PO_ID='" + po_id + "'");
         string batch_no = WebTools.GetExpr("BATCH_NO", "PIP_PO_BATCH_PLAN", " WHERE BATCH_ID='" + Request.QueryString["BATCH_ID"] + "'");
         txtBatchNo.Text = batch_no;
         txtRevNo.Text   = WebTools.DMax("REV_NO", "PIP_PO_BATCH_REV", " WHERE BATCH_ID=" + Request.QueryString["BATCH_ID"]) + 1 + "";
         Master.HeadingMessage("New Batch Revision (PO No/Batch No : " + po_no + "/" + batch_no + ")");
         txtCreateDate.SelectedDate = System.DateTime.Today;
         set_rev_dates();
     }
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        var     mr_item    = string.Empty;
        var     mat_code1  = string.Empty;
        var     bal_to_ord = string.Empty;
        var     mat_id     = string.Empty;
        string  mr_id      = "";
        decimal po_item    = 0;

        Procurement_ATableAdapters.VIEW_ADAPTER_PO_DETAILTableAdapter po_detail = new Procurement_ATableAdapters.VIEW_ADAPTER_PO_DETAILTableAdapter();
        try
        {
            foreach (GridDataItem row in itemsGrid.Items)
            {
                var rcb = (RadCheckBox)row["cbColumn"].FindControl("itemCheck");
                if (Convert.ToBoolean(rcb.Checked))
                {
                    mr_id      = WebTools.GetExpr("MR_ID", "PIP_PO", " WHERE PO_ID = '" + Request.QueryString["PO_ID"] + "'");
                    mr_item    = row["MR_ITEM_NO"].Text;
                    mat_code1  = row["MAT_CODE1"].Text;
                    bal_to_ord = WebTools.GetExpr("BAL_TO_ORD", "VIEW_MR_PO_BAL", " WHERE MR_ID = '" + mr_id + "' AND MR_ITEM_NO='" + mr_item + "'");
                    //bal_to_ord = ((TextBox)row["BAL_TO_ORD"].FindControl("BAL_TO_ORDLabel")).Text;
                    mat_id = WebTools.GetExpr("MAT_ID", "PIP_MAT_STOCK", " WHERE MAT_CODE1='" + mat_code1 + "'");

                    if (string.IsNullOrEmpty(mat_id))
                    {
                        Master.ShowError("Invalid Item Code. Please Contact Administrator.");
                        return;
                    }
                    po_item = WebTools.DMax("PO_ITEM", "VIEW_PO_ITEM_MAX", " WHERE PO_ID='" + Request.QueryString["PO_ID"] + "'");
                    po_detail.InsertQuery(decimal.Parse(Request.QueryString["PO_ID"].ToString()), (po_item + 1).ToString(),
                                          decimal.Parse(mat_id), decimal.Parse(bal_to_ord), null, mr_item);
                }
            }

            Master.ShowSuccess("Selected Items Added to PO");
            itemsGrid.Rebind();
        }
        catch (Exception ex)
        {
            Master.ShowError(ex.Message);
        }
        finally
        {
            po_detail.Dispose();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!WebTools.UserInRole("MM_INSERT"))
            {
                Response.Redirect("~/ErrorPages/NoAccess.htm");
                return;
            }
            string mrir = WebTools.GetExpr("MAT_RCV_NO", "PIP_MAT_RECEIVE", " WHERE MAT_RCV_ID=" +
                                           Request.QueryString["MAT_RCV_ID"]);
            Master.HeadingMessage = "MRR Materials Register <br/> (" + mrir + ")";

            HiddenPOID.Value = WebTools.GetExpr("PO_ID", "PIP_MAT_RECEIVE", " WHERE MAT_RCV_ID='" + Request.QueryString["MAT_RCV_ID"] + "'");
        }
        decimal mr_item_no = WebTools.DMax("MR_ITEM_NUM", "VIEW_ADAPTER_MAT_RCV_DETAIL", " WHERE MAT_RCV_ID='" + Request.QueryString["MAT_RCV_ID"] + "'");

        txtMrItem.Text = (mr_item_no + 1).ToString();
    }
Exemple #8
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        decimal mat_id = WebTools.GetMatId(ddlMatCode.Text, Decimal.Parse(Session["PROJECT_ID"].ToString()));

        if (mat_id == -1)
        {
            //Master.ShowWarn("There are two materials with the same code! try to use the unique one.");
            RadWindowManager1.RadAlert("There are two materials with the same code! try to use the unique one.", 400, 150, "Warning", "");
            return;
        }
        else if (mat_id == 0)
        {
            // Master.ShowWarn("Material Code not found!");
            RadWindowManager1.RadAlert("Material Code not found!", 400, 150, "Warning", "");
            return;
        }

        VIEW_MATERIAL_REQUEST_DTTableAdapter items = new VIEW_MATERIAL_REQUEST_DTTableAdapter();

        try
        {
            items.InsertQuery(decimal.Parse(Request.QueryString["MAT_REQ_ID"]), decimal.Parse(txtMrItem.Text),
                              mat_id, ddlHeatNo.SelectedValue, txtCabledrum.SelectedValue, decimal.Parse(txtReqQty.Text), txtReqDate.SelectedDate, txtRqrdAtLocation.Text,
                              null, null, txtRemarks.Text, decimal.Parse(ddlPO.SelectedValue));
            RadGrid1.DataBind();
            //Master.ShowMessage(txtMatCode.Text + " Saved!");
            RadWindowManager1.RadAlert("Material Added.", 400, 150, "Success", "");
            decimal mr_item_no = WebTools.DMax("MR_ITEM_NO", "MATERIAL_REQUEST_DETAIL", " WHERE MAT_REQ_ID='" + Request.QueryString["MAT_REQ_ID"] + "'");
            txtMrItem.Text = (mr_item_no + 1).ToString();
        }
        catch (Exception ex)
        {
            //Master.ShowWarn(ex.Message);
            RadWindowManager1.RadAlert("Access denied.", 400, 150, "Warning", "");
        }
        finally
        {
            items.Dispose();
        }
    }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     dsMaterialDTableAdapters.VIEW_QUARANTINE_DETAILTableAdapter q = new dsMaterialDTableAdapters.VIEW_QUARANTINE_DETAILTableAdapter();
     try
     {
         q.InsertQuery(Decimal.Parse(ddlMatItem.SelectedValue), decimal.Parse(txtQty.Text), decimal.Parse(ddlQuaranCat.SelectedValue),
                       txtRemarks.Text, decimal.Parse(Request.QueryString["id"].ToString()), txtHeatno.Text, txtDrumno.Text, txtQritem.Text, decimal.Parse(ddlPO.SelectedValue));
         RadGrid1.Rebind();
         Master.ShowMessage(ddlMatItem.SelectedItem.Text + " Added.");
         //RadWindowManager1.RadAlert("Access denied.", 400, 150, "Warning", "");
         decimal qr_item = WebTools.DMax("QR_ITEM", "PIP_MAT_QUARANTINE", " WHERE QRNTINE_ID='" + Request.QueryString["id"] + "'");
         txtQritem.Text = (qr_item + 1).ToString();
     }
     catch (Exception ex)
     {
         Master.ShowError(ex.Message);
         //RadWindowManager1.RadAlert("Access denied.", 400, 150, "Warning", "");
     }
     finally {
         q.Dispose();
     }
 }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Master.HeadingMessage = "Material Request <br/>" + WebTools.GetExpr("MAT_REQ_NO", "MATERIAL_REQUEST", "MAT_REQ_ID=" + Request.QueryString["MAT_REQ_ID"]);
            Master.RadGridList    = RadGrid1.ClientID;
            //Master.AddModalPopup("~/Material/MaterialRequestDetail.aspx", ImageButtonDetails.ClientID, 650, 700);
            hiddenreqStoreID.Value = WebTools.GetExpr("REQ_TO_STORE_ID", "MATERIAL_REQUEST", " WHERE MAT_REQ_ID='" + Request.QueryString["MAT_REQ_ID"] + "'");


            decimal mr_item_no = WebTools.DMax("MR_ITEM_NO", "MATERIAL_REQUEST_DETAIL", " WHERE MAT_REQ_ID='" + Request.QueryString["MAT_REQ_ID"] + "'");
            txtMrItem.Text = (mr_item_no + 1).ToString();
            string status_flg = WebTools.GetExpr("STATUS_FLG", "MATERIAL_REQUEST", " MAT_REQ_ID = " + Request.QueryString["MAT_REQ_ID"]);

            string USER_ID   = WebTools.GetExpr("CREATE_BY", "MATERIAL_REQUEST", " MAT_REQ_ID = " + Request.QueryString["MAT_REQ_ID"]);
            string CREATE_BY = WebTools.GetExpr("USER_NAME", "USERS", " WHERE USER_ID ='" + USER_ID + "'");
            string USER_NAME = Session["USER_NAME"].ToString();
            if ((CREATE_BY.ToUpper() == USER_NAME.ToUpper() && status_flg != "Y") || WebTools.UserInRole("ADMIN"))
            {
                btnEntry.Visible = true;
            }
            else
            {
                btnEntry.Visible = false;
            }
        }
        if (WebTools.UserInRole("ADMIN"))
        {
            btnDeleteAll.Visible             = true;
            this.RadGrid1.Columns[2].Visible = true;
            return;
        }
        else
        {
            this.RadGrid1.Columns[2].Visible = false;
        }
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        decimal report_code = WebTools.DMax("REPORT_CODE", "CUSTOM_REPORT_INDEX", " WHERE 1=1");

        txtReportCode.Text = (report_code + 1).ToString();
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            //////////////////////////////////

            CheckBox cb;
            decimal  mir_item = WebTools.DMax("MIR_ITEM_NUM", "VIEW_ADAPTER_MIR_DT", " WHERE MIR_ID=" + Request.QueryString["MIR_ID"]);
            foreach (GridDataItem item in itemsGrid.Items)
            {
                cb = ((CheckBox)item["checkCol"].FindControl("checkItems"));
                if (cb.Checked)
                {
                    /////////////////////////////////////////////////


                    string tc_id = "";
                    /////////////////////////////////get values////////////////////////////////////
                    string  po_item      = item["PO_ITEM"].Text;
                    string  mat_code1    = item["MAT_CODE1"].Text;
                    string  rfi_id       = WebTools.GetExpr("RFI_ID", "PRC_MAT_INSP", " MIR_ID= '" + Request.QueryString["MIR_ID"] + "'");
                    decimal mat_id       = WebTools.GetMatId(mat_code1, decimal.Parse(Session["PROJECT_ID"].ToString()));
                    string  tc_no        = (item["MTC_NO"].FindControl("txtMTCNo") as TextBox).Text;
                    string  bal_mrir_qty = WebTools.GetExpr("BAL_MRIR_QTY", "VIEW_MRIR_BAL_FROM_RFI", " WHERE RFI_ID = '" + rfi_id + "' AND PO_ITEM='" + po_item +
                                                            "' AND MAT_ID='" + mat_id + "'");
                    //string bal_mrir_qty = (item["BAL_MRIR_QTY"].FindControl("BAL_MRIR_QTYTextBox") as TextBox).Text;
                    string receive_qty   = item["INSP_QTY"].Text;
                    string mrir_qty      = item["MRIR_QTY"].Text;
                    string cable_drum_no = (item["CABLE_DRUM_NO"].FindControl("ddlCableNo") as RadDropDownList).SelectedValue;
                    string heat_no       = (item["HEAT_NO"].FindControl("txtHeatNo") as TextBox).Text;
                    string excess        = (item["EXCESS"].FindControl("txtExcess") as TextBox).Text;
                    string shortage      = (item["SHORTAGE"].FindControl("txtShortage") as TextBox).Text;
                    string damage        = (item["DAMAGE"].FindControl("txtDamage") as TextBox).Text;

                    string substore      = (item["SUBSTORE"].FindControl("ddlsubstore") as RadDropDownList).SelectedValue;
                    string paint_sys     = (item["PAINT_SYS"].FindControl("txtPaintSys") as TextBox).Text;
                    string pl_qty        = (item["PL_QTY"].FindControl("txtPLQty") as TextBox).Text;
                    string unit_wt       = (item["UNIT_WT"].FindControl("txtUnitWt") as TextBox).Text;
                    string remarks       = (item["REMARKS"].FindControl("txtRemarks") as TextBox).Text;
                    string sub_warehouse = (item["SUB_WAREHOUSE"].FindControl("txtSubWarehouse") as TextBox).Text;
                    string line_no       = (item["LINE_NO"].FindControl("txtLineNo") as TextBox).Text;
                    string rack_no       = (item["RACK_NO"].FindControl("txtRackNo") as TextBox).Text;
                    string shelf_no      = (item["SHELF_NO"].FindControl("txtShelfNo") as TextBox).Text;
                    string pieces        = (item["BAL_PIECES"].FindControl("BAL_PIECESTextBox") as TextBox).Text;
                    if (pieces == "N/A" || pieces == "")
                    {
                        pieces = "0";
                    }

                    ////////////////////////////////get values///////////////////////////////////////
                    tc_id = WebTools.GetExpr("TC_ID", "PIP_TEST_CARDS", " UPPER(TC_CODE) = '" + tc_no.ToUpper() + "'");

                    if (tc_id.Trim().Length == 0)
                    {
                        string po_id = WebTools.GetExpr("PO_ID", "PRC_MAT_INSP", " MIR_ID='" + Request.QueryString["MIR_ID"] + "'");
                        //Register New MTC Code.
                        string sql = "INSERT INTO PIP_TEST_CARDS (PROJECT_ID, TC_CODE, PO_ID) VALUES ('" + Session["PROJECT_ID"].ToString() + "', '" +
                                     tc_no.Trim().ToUpper() + "','" + po_id + "')";
                        WebTools.ExeSql(sql);

                        //Get TC_ID for New MTC Code
                        tc_id = WebTools.GetExpr("TC_ID", "PIP_TEST_CARDS", " UPPER(TC_CODE) = '" + tc_no.ToUpper() + "'");
                    }

                    //string mat_id = WebTools.GetExpr("MAT_ID", "PIP_MAT_STOCK", " MAT_CODE1='" + mat_code1 + "'");
                    string itemid = WebTools.GetExpr("ITEM_ID", "PIP_MAT_STOCK", " MAT_ID= " + mat_id);

                    if (decimal.Parse(bal_mrir_qty) > (decimal.Parse(receive_qty) - decimal.Parse(mrir_qty)))
                    {
                        RadWindowManager1.RadAlert("Accepted quantity cannot be more than Inspection qty. <br/>Please re-check and enter valid value.", 300, 150, "Warning", "");
                        return;
                    }

                    //decimal? substore_id = null;
                    //string sub_store_id=   WebTools.GetExpr("SUBSTORE_ID", "STORES_SUB", " STORE_L1= '" + substore+"'");
                    //   if (sub_store_id.Trim().Length == 0)
                    //   {
                    //       RadWindowManager1.RadAlert("Enter Valid Sub Store", 300, 150, "Warning", "");
                    //       return;
                    //   }

                    string sql1 = "";
                    sql1  = "INSERT INTO PRC_MAT_INSP_DETAIL(MIR_ID, PO_ITEM, MIR_ITEM, MAT_ID, RCV_QTY, ACPT_QTY, HEAT_NO, PAINT_SYS, TC_ID, SUBSTORE_ID, REMARKS,CABLE_DRUM_NO, AS_PER_PL_QTY,SUB_WAREHOUSE,LINE_NO,RACK_NO,SHELF_NO,EXC_QTY,SH_QTY,DAMAG_QTY,PIECES) ";
                    sql1 += "VALUES('" + Request.QueryString["MIR_ID"].ToString() + "', '" + po_item + "','" + (++mir_item) + "','" + mat_id + "','";
                    sql1 += bal_mrir_qty + "','" + bal_mrir_qty + "','" + heat_no + "','" + paint_sys + "','" + tc_id + "','" + substore + "','";
                    sql1 += remarks + "','" + cable_drum_no + "', '" + pl_qty + "','" + sub_warehouse + "','" + line_no + "','" + rack_no + "','" + shelf_no + "','" + excess + "','" + shortage + "','" + damage + "','" + pieces + "')";
                    // Master.show_success(sql1);
                    WebTools.ExeSql(sql1);
                }
            }
            Master.ShowMessage("Selected Items Added.");
            itemsGrid.Rebind();
        }
        catch (Exception ex)
        {
            Master.ShowError("Please enter MTC No:" + ex.Message);
        }
    }