Esempio n. 1
0
        public void clearText()
        {
            TextMfWbSlipNo.Text     = "";
            TextMatWeightMf.Text    = "";
            TextMatWeightMs.Text    = "";
            Text1stWeightMs.Text    = "";
            Text2ndWeightMs.Text    = "";
            TextMatWeightMs.Text    = "";
            TextMat1stWeightMf.Text = "";
            TextMat2ndWeightMf.Text = "";
            TextWeightVariance.Text = "";
            CheckSlipNo.Text        = "";
            DropDownVehicleID.Text  = "0";
            DropDownItemID.Text     = "0";

            DataTable dtSlipNoID        = new DataTable();
            DataSet   dss               = new DataSet();
            string    makedtSlipNoIDSQL = " SELECT * FROM MS_SALES_INTER_DIV_MASTER  WHERE IS_ACTIVE = 'Enable' AND IS_MF_RECEIVED_STATUS = 'Pending' AND INTER_DIVISION_ID = '5' ORDER BY WB_SLIP_NO DESC";

            dss        = ExecuteBySqlString(makedtSlipNoIDSQL);
            dtSlipNoID = (DataTable)dss.Tables[0];
            DropDownMsWbSlipNo.DataSource     = dtSlipNoID;
            DropDownMsWbSlipNo.DataValueField = "WB_SLIP_NO";
            DropDownMsWbSlipNo.DataTextField  = "WB_SLIP_NO";
            DropDownMsWbSlipNo.DataBind();
            DropDownMsWbSlipNo.Items.Insert(0, new ListItem("Select MS Weight Slip No", "0"));
            DropDownMsWbSlipNo.Text = "0";

            DropDownItemBinID.Enabled = false;
            BtnAdd.Attributes.Add("aria-disabled", "false");
            BtnAdd.Attributes.Add("class", "btn btn-primary disabled");
        }
Esempio n. 2
0
        protected void linkSelectClick(object sender, EventArgs e)
        {
            //  try{
            OracleConnection conn = new OracleConnection(strConnString);

            conn.Open();
            LinkButton btn = (LinkButton)sender;

            Session["user_data_id"] = btn.CommandArgument;
            int USER_DATA_ID = Convert.ToInt32(Session["user_data_id"]);

            string makeSQL = " select TRANSFER_ID, WB_SLIP_NO,  VEHICLE_ID, ITEM_ID, ITEM_BIN_ID, FIRST_WT_MF, SECOND_WT_MF, NET_WT_MF, NET_WT_MS, VARIANCE, WB_SLIP_NO_MS, REMARKS,  TO_CHAR(ENTRY_DATE,'dd/mm/yyyy') AS ENTRY_DATE, CREATE_DATE,  UPDATE_DATE,  C_USER_ID, U_USER_ID, IS_ACTIVE from MF_PURCHASE_TRANSFER_MASTER where TRANSFER_ID  = '" + USER_DATA_ID + "'";

            cmdl    = new OracleCommand(makeSQL);
            oradata = new OracleDataAdapter(cmdl.CommandText, conn);
            dt      = new DataTable();
            oradata.Fill(dt);
            RowCount = dt.Rows.Count;

            for (int i = 0; i < RowCount; i++)
            {
                DataTable dtItemBinID    = new DataTable();
                DataSet   dsb            = new DataSet();
                string    makeItemBinSQL = " SELECT ITEM_BIN_ID, ITEM_BIN_NAME || ' - Capacity: ' || CAPACITY_WEIGHT || ' (KG)'  AS ITEM_FULL_NAME FROM MF_ITEM_BIN WHERE IS_ACTIVE = 'Enable' AND ITEM_ID = '" + Convert.ToInt32(dt.Rows[i]["ITEM_ID"].ToString()) + "' ORDER BY ITEM_BIN_ID ASC";
                dsb         = ExecuteBySqlString(makeItemBinSQL);
                dtItemBinID = (DataTable)dsb.Tables[0];
                DropDownItemBinID.DataSource     = dtItemBinID;
                DropDownItemBinID.DataValueField = "ITEM_BIN_ID";
                DropDownItemBinID.DataTextField  = "ITEM_FULL_NAME";
                DropDownItemBinID.DataBind();

                TextTransferID.Text    = dt.Rows[i]["TRANSFER_ID"].ToString();
                TextMfWbSlipNo.Text    = dt.Rows[i]["WB_SLIP_NO"].ToString();
                DropDownVehicleID.Text = dt.Rows[i]["VEHICLE_ID"].ToString();
                DropDownItemID.Text    = dt.Rows[i]["ITEM_ID"].ToString();
                //   DropDownItemBinID.Text = dt.Rows[i]["ITEM_BIN_ID"].ToString();
                TextMat1stWeightMf.Text = dt.Rows[i]["FIRST_WT_MF"].ToString();
                TextMat2ndWeightMf.Text = dt.Rows[i]["SECOND_WT_MF"].ToString();
                TextMatWeightMf.Text    = dt.Rows[i]["NET_WT_MF"].ToString();
                TextMatWeightMs.Text    = dt.Rows[i]["NET_WT_MS"].ToString();
                TextWeightVariance.Text = decimal.Parse(dt.Rows[i]["VARIANCE"].ToString()).ToString(".00");
                EntryDate.Text          = dt.Rows[i]["ENTRY_DATE"].ToString();
                TextRemarks.Text        = dt.Rows[i]["REMARKS"].ToString();
                CheckIsActive.Checked   = Convert.ToBoolean(dt.Rows[i]["IS_ACTIVE"].ToString() == "Enable" ? true : false);

                DataTable dtSlipNoID        = new DataTable();
                DataSet   dss               = new DataSet();
                string    makedtSlipNoIDSQL = " SELECT * FROM MS_SALES_INTER_DIV_MASTER  WHERE IS_ACTIVE = 'Enable' AND INTER_DIVISION_ID = '5' ORDER BY WB_SLIP_NO DESC";
                dss        = ExecuteBySqlString(makedtSlipNoIDSQL);
                dtSlipNoID = (DataTable)dss.Tables[0];
                DropDownMsWbSlipNo.DataSource     = dtSlipNoID;
                DropDownMsWbSlipNo.DataValueField = "WB_SLIP_NO";
                DropDownMsWbSlipNo.DataTextField  = "WB_SLIP_NO";
                DropDownMsWbSlipNo.DataBind();
                DropDownMsWbSlipNo.Items.Insert(0, new ListItem("Select MS Weight Slip No", "0"));
                DropDownMsWbSlipNo.Text = dt.Rows[i]["WB_SLIP_NO_MS"].ToString();

                string makeSQL1 = " select  ITEM_ID, WB_SLIP_NO, FIRST_WT, SECOND_WT, ITEM_WEIGHT from MS_SALES_INTER_DIV_MASTER where WB_SLIP_NO  = '" + dt.Rows[i]["WB_SLIP_NO_MS"].ToString() + "'";
                cmdl    = new OracleCommand(makeSQL1);
                oradata = new OracleDataAdapter(cmdl.CommandText, conn);
                dt      = new DataTable();
                oradata.Fill(dt);
                RowCount = dt.Rows.Count;

                for (int j = 0; j < RowCount; j++)
                {
                    Text1stWeightMs.Text = dt.Rows[j]["FIRST_WT"].ToString();
                    Text2ndWeightMs.Text = dt.Rows[j]["SECOND_WT"].ToString();
                    TextMatWeightMs.Text = dt.Rows[j]["ITEM_WEIGHT"].ToString();
                }
            }

            conn.Close();
            Display();
            PendingReceiving();
            CheckSlipNo.Text           = "";
            alert_box.Visible          = false;
            DropDownItemBinID.Enabled  = true;
            DropDownMsWbSlipNo.Enabled = true;
            BtnAdd.Attributes.Add("aria-disabled", "false");
            BtnAdd.Attributes.Add("class", "btn btn-primary disabled");

            BtnUpdate.Attributes.Add("aria-disabled", "true");
            BtnUpdate.Attributes.Add("class", "btn btn-success active");
            BtnDelete.Attributes.Add("aria-disabled", "true");
            BtnDelete.Attributes.Add("class", "btn btn-danger active");

            //   }
            //    catch
            //    {
            //     Response.Redirect("~/ParameterError.aspx");
            //  }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USER_NAME"] != null)
            {
                string           requestedFile = Path.GetFileName(Request.Path);
                OracleConnection conn          = new OracleConnection(strConnString);
                conn.Open();
                string makeSQL = " SELECT  NUPP.IS_PAGE_ACTIVE, NUPP.IS_ADD_ACTIVE, NUPP.IS_EDIT_ACTIVE, NUPP.IS_DELETE_ACTIVE, NUPP.IS_VIEW_ACTIVE, NUPP.IS_REPORT_ACTIVE, NUPP.IS_PRINT_ACTIVE FROM NRC_USER_PAGE_PERMISSION NUPP LEFT JOIN NRC_USER_PAGES NUP ON NUP.USER_PAGE_ID = NUPP.USER_PAGE_ID  WHERE NUPP.USER_ID = '" + Session["USER_ID"] + "' AND NUP.IS_ACTIVE = 'Enable' AND NUP.PAGE_URL = '" + requestedFile + "' ";
                cmdl    = new OracleCommand(makeSQL);
                oradata = new OracleDataAdapter(cmdl.CommandText, conn);
                dt      = new DataTable();
                oradata.Fill(dt);
                RowCount = dt.Rows.Count;

                for (int i = 0; i < RowCount; i++)
                {
                    IS_PAGE_ACTIVE   = dt.Rows[i]["IS_PAGE_ACTIVE"].ToString();
                    IS_ADD_ACTIVE    = dt.Rows[i]["IS_ADD_ACTIVE"].ToString();
                    IS_EDIT_ACTIVE   = dt.Rows[i]["IS_EDIT_ACTIVE"].ToString();
                    IS_DELETE_ACTIVE = dt.Rows[i]["IS_DELETE_ACTIVE"].ToString();
                    IS_VIEW_ACTIVE   = dt.Rows[i]["IS_VIEW_ACTIVE"].ToString();
                    IS_REPORT_ACTIVE = dt.Rows[i]["IS_REPORT_ACTIVE"].ToString();
                    IS_PRINT_ACTIVE  = dt.Rows[i]["IS_PRINT_ACTIVE"].ToString();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtID           = new DataTable();
                        DataSet   ds             = new DataSet();
                        string    makeVehicleSQL = " SELECT * FROM MF_VEHICLE  WHERE IS_ACTIVE = 'Enable' ORDER BY VEHICLE_NO ASC";
                        ds   = ExecuteBySqlString(makeVehicleSQL);
                        dtID = (DataTable)ds.Tables[0];
                        DropDownVehicleID.DataSource     = dtID;
                        DropDownVehicleID.DataValueField = "VEHICLE_ID";
                        DropDownVehicleID.DataTextField  = "VEHICLE_NO";
                        DropDownVehicleID.DataBind();
                        DropDownVehicleID.Items.Insert(0, new ListItem("Select Vehicle Number ", "0"));

                        DataTable dtSlipNoID        = new DataTable();
                        DataSet   dss               = new DataSet();
                        string    makedtSlipNoIDSQL = " SELECT * FROM MS_SALES_INTER_DIV_MASTER  WHERE IS_ACTIVE = 'Enable' AND IS_MF_RECEIVED_STATUS IS NULL AND INTER_DIVISION_ID = '5' ORDER BY WB_SLIP_NO DESC";
                        dss        = ExecuteBySqlString(makedtSlipNoIDSQL);
                        dtSlipNoID = (DataTable)dss.Tables[0];
                        DropDownMsWbSlipNo.DataSource     = dtSlipNoID;
                        DropDownMsWbSlipNo.DataValueField = "WB_SLIP_NO";
                        DropDownMsWbSlipNo.DataTextField  = "WB_SLIP_NO";
                        DropDownMsWbSlipNo.DataBind();
                        DropDownMsWbSlipNo.Items.Insert(0, new ListItem("Select MS Weight Slip No", "0"));

                        DataTable dtItemID    = new DataTable();
                        DataSet   dsi         = new DataSet();
                        string    makeItemSQL = " SELECT ITEM_ID, ITEM_NAME || ' - ' || ITEM_CODE AS ITEM_FULL_NAME FROM MF_ITEM WHERE IS_ACTIVE = 'Enable' AND IS_TRANSFER_ACTIVE = 'Enable' ORDER BY ITEM_ID ASC";
                        dsi      = ExecuteBySqlString(makeItemSQL);
                        dtItemID = (DataTable)dsi.Tables[0];
                        DropDownItemID.DataSource     = dtItemID;
                        DropDownItemID.DataValueField = "ITEM_ID";
                        DropDownItemID.DataTextField  = "ITEM_FULL_NAME";
                        DropDownItemID.DataBind();
                        DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                        DropDownItemID1.DataSource     = dtItemID;
                        DropDownItemID1.DataValueField = "ITEM_ID";
                        DropDownItemID1.DataTextField  = "ITEM_FULL_NAME";
                        DropDownItemID1.DataBind();
                        DropDownItemID1.Items.Insert(0, new ListItem("Select  Item", "0"));

                        /*      DataTable dtItemBinID = new DataTable();
                         *    DataSet dsb = new DataSet();
                         *    string makeItemBinSQL = " SELECT ITEM_BIN_ID, ITEM_BIN_NAME || ' - Capacity: ' || CAPACITY_WEIGHT || ' (KG)'  AS ITEM_FULL_NAME FROM MF_ITEM_BIN WHERE IS_ACTIVE = 'Enable' ORDER BY ITEM_BIN_ID ASC";
                         *    dsb = ExecuteBySqlString(makeItemBinSQL);
                         *    dtItemBinID = (DataTable)dsb.Tables[0];
                         *    DropDownItemBinID.DataSource = dtItemBinID;
                         *    DropDownItemBinID.DataValueField = "ITEM_BIN_ID";
                         *    DropDownItemBinID.DataTextField = "ITEM_FULL_NAME";
                         *    DropDownItemBinID.DataBind();
                         *    DropDownItemBinID.Items.Insert(0, new ListItem("Select  Item Bin", "0")); */

                        DropDownMsWbSlipNo.Focus();
                        Text1stWeightMs.Attributes.Add("readonly", "readonly");
                        Text2ndWeightMs.Attributes.Add("readonly", "readonly");
                        TextMatWeightMs.Attributes.Add("readonly", "readonly");
                        TextMatWeightMf.Attributes.Add("readonly", "readonly");
                        TextWeightVariance.Enabled = false;
                        DropDownItemBinID.Enabled  = false;
                        DropDownItemID.Enabled     = false;

                        BtnUpdate.Attributes.Add("aria-disabled", "false");
                        BtnUpdate.Attributes.Add("class", "btn btn-success disabled");
                        BtnDelete.Attributes.Add("aria-disabled", "false");
                        BtnDelete.Attributes.Add("class", "btn btn-danger disabled");

                        Display();
                        DisplaySummary();
                        PendingReceiving();
                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }