Exemplo n.º 1
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 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();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtCatID            = new DataTable();
                        DataSet   dc                 = new DataSet();
                        string    makeDropDownCatSQL = " SELECT ITEM_ID, ITEM_NAME || ' - ' || ITEM_CODE AS ITEM_NAME FROM MF_ITEM WHERE IS_ACTIVE = 'Enable' ORDER BY ITEM_ID ASC";
                        dc      = ExecuteBySqlString(makeDropDownCatSQL);
                        dtCatID = (DataTable)dc.Tables[0];
                        DropDownItemID.DataSource     = dtCatID;
                        DropDownItemID.DataValueField = "ITEM_ID";
                        DropDownItemID.DataTextField  = "ITEM_NAME";
                        DropDownItemID.DataBind();
                        DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                        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");

                        DropDownItemID.Focus();
                        Display();
                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }
Exemplo n.º 2
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 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();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtShiftID    = new DataTable();
                        DataSet   ds           = new DataSet();
                        string    makeShiftSQL = " SELECT * FROM PF_PRODUCTION_SHIFT WHERE IS_ACTIVE = 'Enable' ORDER BY SHIFT_NAME ASC";
                        ds        = ExecuteBySqlString(makeShiftSQL);
                        dtShiftID = (DataTable)ds.Tables[0];
                        DropDownShiftID.DataSource     = dtShiftID;
                        DropDownShiftID.DataValueField = "SHIFT_ID";
                        DropDownShiftID.DataTextField  = "SHIFT_NAME";
                        DropDownShiftID.DataBind();
                        DropDownShiftID.Items.Insert(0, new ListItem("Select  Shift", "0"));

                        DataTable dtMachineID    = new DataTable();
                        DataSet   dsl            = new DataSet();
                        string    makeMachineSQL = " SELECT * FROM PF_PRODUCTION_MACHINE WHERE IS_ACTIVE = 'Enable' ORDER BY MACHINE_ID ASC";
                        dsl         = ExecuteBySqlString(makeMachineSQL);
                        dtMachineID = (DataTable)dsl.Tables[0];
                        DropDownMachineID.DataSource     = dtMachineID;
                        DropDownMachineID.DataValueField = "MACHINE_ID";
                        DropDownMachineID.DataTextField  = "MACHINE_NUMBER";
                        DropDownMachineID.DataBind();
                        DropDownMachineID.Items.Insert(0, new ListItem("Select Machine Number", "0"));

                        DataTable dtSupervisorID    = new DataTable();
                        DataSet   dsd               = new DataSet();
                        string    makeSupervisorSQL = " SELECT * FROM PF_SUPERVISOR WHERE IS_ACTIVE = 'Enable' ORDER BY SUPERVISOR_NAME ASC";
                        dsd            = ExecuteBySqlString(makeSupervisorSQL);
                        dtSupervisorID = (DataTable)dsd.Tables[0];
                        DropDownSupervisorID.DataSource     = dtSupervisorID;
                        DropDownSupervisorID.DataValueField = "SUPERVISOR_ID";
                        DropDownSupervisorID.DataTextField  = "SUPERVISOR_NAME";
                        DropDownSupervisorID.DataBind();
                        DropDownSupervisorID.Items.Insert(0, new ListItem("Select  Supervisor", "0"));



                        DataTable dtItemID            = new DataTable();
                        DataSet   dsi                 = new DataSet();
                        string    makeDropDownItemSQL = " SELECT * FROM PF_ITEM WHERE IS_ACTIVE = 'Enable' ORDER BY ITEM_ID ASC";
                        dsi      = ExecuteBySqlString(makeDropDownItemSQL);
                        dtItemID = (DataTable)dsi.Tables[0];
                        DropDownItemID.DataSource     = dtItemID;
                        DropDownItemID.DataValueField = "ITEM_ID";
                        DropDownItemID.DataTextField  = "ITEM_NAME";
                        DropDownItemID.DataBind();
                        DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

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

                        DataTable dtSubItemID            = new DataTable();
                        DataSet   dss                    = new DataSet();
                        string    makeDropDownSubItemSQL = " SELECT * FROM PF_SUB_ITEM WHERE IS_ACTIVE = 'Enable' ORDER BY SUB_ITEM_ID ASC";
                        dss         = ExecuteBySqlString(makeDropDownSubItemSQL);
                        dtSubItemID = (DataTable)dss.Tables[0];
                        DropDownSubItemID.DataSource     = dtSubItemID;
                        DropDownSubItemID.DataValueField = "SUB_ITEM_ID";
                        DropDownSubItemID.DataTextField  = "SUB_ITEM_NAME";
                        DropDownSubItemID.DataBind();
                        DropDownSubItemID.Items.Insert(0, new ListItem("Select Sub Item", "0"));


                        Display();
                        DropDownShiftID.Focus();
                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }
Exemplo 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 dtSupplierID    = new DataTable();
                        DataSet   ds              = new DataSet();
                        string    makeSupplierSQL = " SELECT PARTY_ID, PARTY_ID  || ' - ' || PARTY_NAME || ' - ' || PARTY_VAT_NO AS PARTY_NAME  FROM MF_PARTY WHERE IS_ACTIVE = 'Enable' AND IS_PURCHASE_ACTIVE = 'Enable' ORDER BY PARTY_NAME ASC";
                        ds           = ExecuteBySqlString(makeSupplierSQL);
                        dtSupplierID = (DataTable)ds.Tables[0];
                        DropDownSupplierID.DataSource     = dtSupplierID;
                        DropDownSupplierID.DataValueField = "PARTY_ID";
                        DropDownSupplierID.DataTextField  = "PARTY_NAME";
                        DropDownSupplierID.DataBind();
                        DropDownSupplierID.Items.Insert(0, new ListItem("Select  Supplier", "0"));


                        DataTable dtItemID    = new DataTable();
                        DataSet   dsi         = new DataSet();
                        string    makeItemSQL = " SELECT ITEM_ID, ITEM_CODE || ' : ' || ITEM_NAME AS ITEM_FULL_NAME FROM MF_ITEM WHERE IS_ACTIVE = 'Enable' AND IS_PURCHASE_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_NAME";
                         * DropDownItemID1.DataBind();
                         * DropDownItemID1.Items.Insert(0, new ListItem("All Item", "0")); */

                        DataTable dtContainerID            = new DataTable();
                        DataSet   dsc                      = new DataSet();
                        string    makeDropDownContainerSQL = " SELECT CONTAINER_SIZE_ID, CONTAINER_SIZE || '- (' || CONTAINER_SIZE_INWORDS || ')' AS CONTAINER_SIZE FROM NRC_CONTAINER_SIZE WHERE IS_ACTIVE = 'Enable' ORDER BY CONTAINER_SIZE_ID ASC";
                        dsc           = ExecuteBySqlString(makeDropDownContainerSQL);
                        dtContainerID = (DataTable)dsc.Tables[0];
                        DropDownContainerSizeID.DataSource     = dtContainerID;
                        DropDownContainerSizeID.DataValueField = "CONTAINER_SIZE_ID";
                        DropDownContainerSizeID.DataTextField  = "CONTAINER_SIZE";
                        DropDownContainerSizeID.DataBind();

                        DataTable dtPacking1ID            = new DataTable();
                        DataSet   dsp                     = new DataSet();
                        string    makeDropDownPacking1SQL = " SELECT * FROM NRC_PACKING_LIST WHERE IS_ACTIVE = 'Enable' ORDER BY PACKING_ID ASC";
                        dsp          = ExecuteBySqlString(makeDropDownPacking1SQL);
                        dtPacking1ID = (DataTable)dsp.Tables[0];
                        DropDownPacking1.DataSource     = dtPacking1ID;
                        DropDownPacking1.DataValueField = "PACKING_ID";
                        DropDownPacking1.DataTextField  = "PACKING_NAME";
                        DropDownPacking1.DataBind();
                        DropDownPacking1.Items.Insert(0, new ListItem("Select Packing List", "0"));
                        DropDownPacking1.Items.FindByValue("1").Selected = true;

                        TextSlipNo.Focus();
                        TextWtTotalPacking1.Attributes.Add("readonly", "readonly");

                        Display();
                        DisplaySummary();
                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }
Exemplo n.º 4
0
        protected void LinkSelectClick(object sender, EventArgs e)
        {
            OracleConnection conn = new OracleConnection(strConnString);

            conn.Open();

            LinkButton btn = (LinkButton)sender;

            Session["user_data_id"] = btn.CommandArgument;
            //   string[] USER_DATA_ID = Session["user_data_id"].ToString().Split('-');
            string USER_DATA_ID = Session["user_data_id"].ToString();

            DataTable dtSlipNo    = new DataTable();
            DataSet   dss         = new DataSet();
            string    makePageSQL = "  SELECT PEWC.WB_SLIP_NO,  PEWC.CONTAINER_NO || ' - ' || PEWC.WB_SLIP_NO  || '' || ', Item WT(WB) -' || TO_CHAR(PEWC.ITEM_WEIGHT_WB, '999,999,999') AS PARTY_NAME FROM MS_EXPORT_WBSLIP_CON PEWC WHERE  PEWC.EXPORT_INVOICE_NO IS NULL  ORDER BY PEWC.WB_SLIP_NO ASC ";

            dss      = ExecuteBySqlString(makePageSQL);
            dtSlipNo = (DataTable)dss.Tables[0];
            DropDownWpSlipNoEx.DataSource     = dtSlipNo;
            DropDownWpSlipNoEx.DataValueField = "WB_SLIP_NO";
            DropDownWpSlipNoEx.DataTextField  = "PARTY_NAME";
            DropDownWpSlipNoEx.DataBind();
            DropDownWpSlipNoEx.Items.Insert(0, new ListItem("Select Weight / Container", "0"));

            string makeSQL = " SELECT PEWCI.EXP_WBCON_ITEM_ID, PEWCI.WB_SLIP_NO, PEWCI.ITEM_ID, PEWCI.ITEM_SALES_ID, PEWCI.MAT_PRICE_PER_MT, PEWCI.MATERIAL_AMOUNT, PEWCI.ITEM_WEIGHT, NCR.CURRENCY_RATE_ID || '-' || NCR.EXCHANGE_RATE AS CURRENCY_RATE_ID, PEWCI.CURRENCY_RATE, PEWCI.MATERIAL_CONVERSION_AMOUNT, PEWCI.IS_ACTIVE_PRICING, PEWCI.UPDATE_DATE_PRICING, PEWCI.U_USER_ID_PRICING FROM MS_EXPORT_WBSLIP_CON_ITEM PEWCI LEFT JOIN  NRC_CURRENCY_RATE NCR ON NCR.CURRENCY_RATE_ID = PEWCI.CURRENCY_RATE_ID WHERE PEWCI.EXP_WBCON_ITEM_ID = '" + USER_DATA_ID + "'";

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

            for (int i = 0; i < RowCount; i++)
            {
                DataTable dtItemID    = new DataTable();
                DataSet   dsi         = new DataSet();
                string    makeItemSQL = " SELECT WEECI.EXP_WBCON_ITEM_ID || '-' || WEECI.ITEM_WEIGHT || '-' || WI.ITEM_ID AS EXP_WBCON_ITEM_ID, WEECI.WB_SLIP_NO,  WI.ITEM_NAME || ' - ' || WI.ITEM_CODE || '- Item Weight: ' || WEECI.ITEM_WEIGHT || ', No Of Pack: ' || WEECI.NUMBER_OF_PACK  AS ITEM_NAME FROM MS_EXPORT_WBSLIP_CON_ITEM WEECI LEFT JOIN MF_ITEM WI ON WI.ITEM_ID = WEECI.ITEM_ID WHERE WEECI.WB_SLIP_NO = '" + ds.Rows[i]["WB_SLIP_NO"].ToString() + "' ";
                dsi      = ExecuteBySqlString(makeItemSQL);
                dtItemID = (DataTable)dsi.Tables[0];
                DropDownItemID.DataSource     = dtItemID;
                DropDownItemID.DataValueField = "EXP_WBCON_ITEM_ID";
                DropDownItemID.DataTextField  = "ITEM_NAME";
                DropDownItemID.DataBind();
                DropDownItemID.Items.Insert(0, new ListItem("Please Select Item", "0"));

                DataTable dtSalesItemID    = new DataTable();
                DataSet   dssi             = new DataSet();
                string    makeSalesItemSQL = " SELECT ITEM_SALES_ID, ITEM_SALES_DESCRIPTION, ITEM_ID FROM MS_SALES_ITEM WHERE ITEM_ID = '" + ds.Rows[i]["ITEM_ID"].ToString() + "' AND IS_ACTIVE = 'Enable'  ";
                dssi          = ExecuteBySqlString(makeSalesItemSQL);
                dtSalesItemID = (DataTable)dssi.Tables[0];
                DropDownSalesItemID.DataSource     = dtSalesItemID;
                DropDownSalesItemID.DataValueField = "ITEM_SALES_ID";
                DropDownSalesItemID.DataTextField  = "ITEM_SALES_DESCRIPTION";
                DropDownSalesItemID.DataBind();
                DropDownSalesItemID.Items.Insert(0, new ListItem("Please Select Sales Item Name", "0"));

                //  DropDownWpSlipNoEx.Text        = ds.Rows[i]["WB_SLIP_NO"].ToString() + "-"+ ds.Rows[i]["ITEM_WEIGHT"].ToString();
                DropDownWpSlipNoEx.Text  = ds.Rows[i]["WB_SLIP_NO"].ToString();
                DropDownItemID.Text      = ds.Rows[i]["EXP_WBCON_ITEM_ID"].ToString() + "-" + ds.Rows[i]["ITEM_WEIGHT"].ToString() + "-" + ds.Rows[i]["ITEM_ID"].ToString();
                DropDownSalesItemID.Text = ds.Rows[i]["ITEM_SALES_ID"].ToString();
                double TotalQty = Convert.ToDouble(ds.Rows[i]["ITEM_WEIGHT"].ToString()) / 1000;
                TextTotalQty.Text           = decimal.Parse(TotalQty.ToString()).ToString("0.000");
                TextPricePerMt.Text         = decimal.Parse(ds.Rows[i]["MAT_PRICE_PER_MT"].ToString()).ToString(".00");
                TextTotalAmountEx.Text      = decimal.Parse(ds.Rows[i]["MATERIAL_AMOUNT"].ToString()).ToString(".00");
                DropDownCurrencyRateID.Text = ds.Rows[i]["CURRENCY_RATE_ID"].ToString();
                TextItemCurrencyAmount.Text = decimal.Parse(ds.Rows[i]["MATERIAL_CONVERSION_AMOUNT"].ToString()).ToString(".00");
                CheckIsActive.Checked       = Convert.ToBoolean(ds.Rows[i]["IS_ACTIVE_PRICING"].ToString() == "Enable" ? true : false);
            }

            Display();
            conn.Close();
            alert_box.Visible = false;

            DropDownWpSlipNoEx.Enabled = false;
            //   DropDownItemID.Enabled = false;
            BtnUpdate.Attributes.Add("aria-disabled", "true");
            BtnUpdate.Attributes.Add("class", "btn btn-success active");
        }
Exemplo n.º 5
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 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();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtCustomerID    = new DataTable();
                        DataSet   ds              = new DataSet();
                        string    makeCustomerSQL = " SELECT PP.PARTY_ID, PP.PARTY_NAME FROM PF_PURCHASE_JW PPJ LEFT JOIN PF_PARTY PP ON PP.PARTY_ID =  PPJ.PARTY_ID WHERE PP.IS_ACTIVE = 'Enable' GROUP BY  PP.PARTY_ID, PP.PARTY_NAME ORDER BY PP.PARTY_NAME ASC";
                        ds           = ExecuteBySqlStringEmpType(makeCustomerSQL);
                        dtCustomerID = (DataTable)ds.Tables[0];
                        DropDownCustomerID.DataSource     = dtCustomerID;
                        DropDownCustomerID.DataValueField = "PARTY_ID";
                        DropDownCustomerID.DataTextField  = "PARTY_NAME";
                        DropDownCustomerID.DataBind();
                        DropDownCustomerID.Items.Insert(0, new ListItem("Select Customer", "0"));

                        DataTable dtItemID            = new DataTable();
                        DataSet   dsi                 = new DataSet();
                        string    makeDropDownItemSQL = " SELECT * FROM PF_ITEM WHERE IS_ACTIVE = 'Enable' ORDER BY ITEM_ID ASC";
                        dsi      = ExecuteBySqlStringEmpType(makeDropDownItemSQL);
                        dtItemID = (DataTable)dsi.Tables[0];
                        DropDownItemID.DataSource     = dtItemID;
                        DropDownItemID.DataValueField = "ITEM_ID";
                        DropDownItemID.DataTextField  = "ITEM_NAME";
                        DropDownItemID.DataBind();
                        DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

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

                        DataTable dtSubItemID            = new DataTable();
                        DataSet   dss                    = new DataSet();
                        string    makeDropDownSubItemSQL = " SELECT * FROM PF_SUB_ITEM WHERE IS_ACTIVE = 'Enable' ORDER BY SUB_ITEM_ID ASC";
                        dss         = ExecuteBySqlStringEmpType(makeDropDownSubItemSQL);
                        dtSubItemID = (DataTable)dss.Tables[0];
                        DropDownSubItemID.DataSource     = dtSubItemID;
                        DropDownSubItemID.DataValueField = "SUB_ITEM_ID";
                        DropDownSubItemID.DataTextField  = "SUB_ITEM_NAME";
                        DropDownSubItemID.DataBind();
                        DropDownSubItemID.Items.Insert(0, new ListItem("Select Sub Item", "0"));

                        DataTable dtPgeID            = new DataTable();
                        DataSet   dsp                = new DataSet();
                        string    makeDropDownPgeSQL = " SELECT * FROM NRC_VAT WHERE IS_ACTIVE = 'Enable' ORDER BY VAT_ID ASC";
                        dsp     = ExecuteBySqlStringEmpType(makeDropDownPgeSQL);
                        dtPgeID = (DataTable)dsp.Tables[0];
                        DropDownVatID.DataSource     = dtPgeID;
                        DropDownVatID.DataValueField = "VAT_ID";
                        DropDownVatID.DataTextField  = "VAT_PERCENT";
                        DropDownVatID.DataBind();
                        //   DropDownVatID.Items.Insert(0, new ListItem("Select Garbage Est. of Prod.", "0"));

                        DropDownCustomerID.Attributes.Add("disabled", "disabled");
                        //  TextItemWeight.Attributes.Add("disabled", "disabled");

                        TextInvoiceNo.Focus();

                        Display();
                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }
Exemplo n.º 6
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");
            }
        }
Exemplo n.º 7
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 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();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtEmpID    = new DataTable();
                        DataSet   ds         = new DataSet();
                        string    makeEmpSQL = " SELECT EMP_ID, EMP_ID || ' - ' || EMP_FNAME || ' ' || EMP_LNAME AS EMP_NAME from HR_EMPLOYEES WHERE IS_ACTIVE = 'Enable' ORDER BY EMP_ID ASC";
                        ds      = ExecuteBySqlString(makeEmpSQL);
                        dtEmpID = (DataTable)ds.Tables[0];
                        DropDownEmployeeID.DataSource     = dtEmpID;
                        DropDownEmployeeID.DataValueField = "EMP_ID";
                        DropDownEmployeeID.DataTextField  = "EMP_NAME";
                        DropDownEmployeeID.DataBind();
                        DropDownEmployeeID.Items.Insert(0, new ListItem("Select  Employee", "0"));

                        DataTable dtItemID    = new DataTable();
                        DataSet   di          = new DataSet();
                        string    makeItemSQL = " SELECT IAEI.EMP_ITEMS_ID, AI.ITEM_NAME || ' - ' || AI.ITEM_TYPE || ' ' || AI.ITEM_BRAND AS ITEM_NAME_ALL from IT_ASSET_EMP_ITEMS IAEI  LEFT JOIN  IT_ASSET_ITEMS AI ON AI.ITEM_ID = IAEI.ITEM_ID  LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AI.ITEM_CATEGORY_ID WHERE AI.IS_ACTIVE = 'Enable' AND (AIC.ITEM_CAT_QR_PRI_CODE = 'CPU' OR AIC.ITEM_CAT_QR_PRI_CODE = 'ITD') ORDER BY AI.ITEM_ID ASC";
                        di       = ExecuteBySqlString(makeItemSQL);
                        dtItemID = (DataTable)di.Tables[0];
                        DropDownItemID.DataSource     = dtItemID;
                        DropDownItemID.DataValueField = "EMP_ITEMS_ID";
                        DropDownItemID.DataTextField  = "ITEM_NAME_ALL";
                        DropDownItemID.DataBind();
                        DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                        DataTable dtItemExpID    = new DataTable();
                        DataSet   die            = new DataSet();
                        string    makeItemExpSQL = " SELECT AIE.ITEM_EXP_ID, AIE.ITEM_EXP_NAME from IT_ASSET_ITEM_EXPIRES AIE LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AIE.ITEM_CATEGORY_ID WHERE AIE.IS_ACTIVE = 'Enable' ORDER BY  AIE.ITEM_EXP_ID ASC";
                        die         = ExecuteBySqlString(makeItemExpSQL);
                        dtItemExpID = (DataTable)die.Tables[0];
                        DropDownItemExpID.DataSource     = dtItemExpID;
                        DropDownItemExpID.DataValueField = "ITEM_EXP_ID";
                        DropDownItemExpID.DataTextField  = "ITEM_EXP_NAME";
                        DropDownItemExpID.DataBind();
                        DropDownItemExpID.Items.Insert(0, new ListItem("Select  Item Expire", "0"));

                        DataTable dtDepartmentID    = new DataTable();
                        DataSet   dep               = new DataSet();
                        string    makeDepartmentSQL = " SELECT * FROM HR_EMP_DEPARTMENTS WHERE IS_ACTIVE = 'Enable' ORDER BY DEPARTMENT_ID ASC";
                        dep            = ExecuteBySqlString(makeDepartmentSQL);
                        dtDepartmentID = (DataTable)dep.Tables[0];
                        DropDownDepartmentID.DataSource     = dtDepartmentID;
                        DropDownDepartmentID.DataValueField = "DEPARTMENT_ID";
                        DropDownDepartmentID.DataTextField  = "DEPARTMENT_NAME";
                        DropDownDepartmentID.DataBind();
                        DropDownDepartmentID.Items.Insert(0, new ListItem("Select  Department", "0"));

                        DataTable dtDivisionID    = new DataTable();
                        DataSet   dsd             = new DataSet();
                        string    makeDivisionSQL = " SELECT * FROM HR_EMP_DIVISIONS WHERE IS_ACTIVE = 'Enable' ORDER BY DIVISION_ID ASC";
                        dsd          = ExecuteBySqlString(makeDivisionSQL);
                        dtDivisionID = (DataTable)dsd.Tables[0];
                        DropDownDivisionID.DataSource     = dtDivisionID;
                        DropDownDivisionID.DataValueField = "DIVISION_ID";
                        DropDownDivisionID.DataTextField  = "DIVISION_NAME";
                        DropDownDivisionID.DataBind();
                        DropDownDivisionID.Items.Insert(0, new ListItem("Select  Division", "0"));

                        DataTable dtLocationID    = new DataTable();
                        DataSet   dsl             = new DataSet();
                        string    makeLocationSQL = " SELECT * FROM HR_EMP_LOCATIONS WHERE IS_ACTIVE = 'Enable' ORDER BY LOCATION_ID ASC";
                        dsl          = ExecuteBySqlString(makeLocationSQL);
                        dtLocationID = (DataTable)dsl.Tables[0];
                        DropDownLocationID.DataSource     = dtLocationID;
                        DropDownLocationID.DataValueField = "LOCATION_ID";
                        DropDownLocationID.DataTextField  = "LOCATION_NAME";
                        DropDownLocationID.DataBind();
                        DropDownLocationID.Items.Insert(0, new ListItem("Select  Location", "0"));

                        DataTable dtPlacementID    = new DataTable();
                        DataSet   depl             = new DataSet();
                        string    makePlacementSQL = " SELECT * FROM IT_ASSET_ITEMS_PLACEMENT WHERE IS_ACTIVE = 'Enable' ORDER BY PLACEMENT_ID ASC";
                        depl          = ExecuteBySqlString(makePlacementSQL);
                        dtPlacementID = (DataTable)depl.Tables[0];
                        DropDownPlacementID.DataSource     = dtPlacementID;
                        DropDownPlacementID.DataValueField = "PLACEMENT_ID";
                        DropDownPlacementID.DataTextField  = "PLACEMENT_NAME";
                        DropDownPlacementID.DataBind();
                        DropDownPlacementID.Items.Insert(0, new ListItem("Select Placement", "0"));

                        //  Display();
                        DropDownItemID.Attributes.Add("disabled", "disabled");
                        //     TextQrImage.Visible = false;
                        alert_box.Visible = false;
                        ExpDept.Visible   = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }
Exemplo n.º 8
0
        /*    protected void DisplayItemCatQRPriCode(object sender, EventArgs e)
         *  {
         *       OracleConnection conn = new OracleConnection(strConnString);
         *       conn.Open();
         *
         *       int USER_DATA_ID = Convert.ToInt32(DropDownItemExpID.Text);
         *
         *
         *       DataTable dtUserTypeID = new DataTable();
         *       DataSet ds = new DataSet();
         *       string makeSQL = " select AIC.ITEM_CAT_QR_PRI_CODE  from IT_ASSET_ITEM_EXPIRES AIE left join IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AIE.ITEM_CATEGORY_ID  where AIE.ITEM_EXP_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++)
         *       {
         *           TextQRPreCode.Text = dt.Rows[i]["ITEM_CAT_QR_PRI_CODE"].ToString();
         *       }
         *
         *       conn.Close();
         *  //     Display();
         *       CheckQRCode.Text = "";
         *       alert_box.Visible = false;
         *       BtnAdd.Attributes.Add("aria-disabled", "false");
         *       BtnAdd.Attributes.Add("class", "btn btn-primary disabled");
         *
         *       if (EmpStatus == 0)
         *       {
         *        //   PlaceHolder1.Text = "if";
         *       }
         *       else
         *       {
         *         //  PlaceHolder1.Text = "else";
         *           GridViewItem.UseAccessibleHeader = true;
         *           GridViewItem.HeaderRow.TableSection = TableRowSection.TableHeader;
         *
         *
         *       }
         *
         *
         *
         *  } */


        public void DisplayEmpItem(object sender, EventArgs e)
        {
            OracleConnection conn = new OracleConnection(strConnString);

            conn.Open();
            DataTable dtItemID = new DataTable();
            DataSet   di = new DataSet();
            string    USER_DATA_ID0 = ""; int USER_DATA_ID = 0, USER_DATA_ID2 = 0, USER_DATA_ID3 = 0, USER_DATA_ID4 = 0; string makeSQL = "";

            if (radExpSelect.SelectedValue == "Employee")
            {
                USER_DATA_ID0 = DropDownEmployeeID.SelectedValue;
                makeSQL       = " select AEIE.*, AIE.ITEM_EXP_NAME, (EXTRACT (DAY FROM (AEIE.EXPIRES_DATE-SYSDATE)))  AS EXPIRED_DAYS_BET,  AEIE.EXPIRED_DAYS , AEIE.IS_ACTIVE from IT_ASSET_EMP_ITEM_EXPIRES AEIE left join IT_ASSET_ITEM_EXPIRES AIE ON AIE.ITEM_EXP_ID = AEIE.ITEM_EXP_ID where AEIE.EMP_ID = '" + USER_DATA_ID0 + "' order by AEIE.EMP_ITEM_EXP_ID";


                string makeItemSQL = " SELECT IAEI.EMP_ITEMS_ID, AI.ITEM_NAME || ' - ' || AI.ITEM_TYPE || ' ' || AI.ITEM_BRAND AS ITEM_NAME_ALL from IT_ASSET_EMP_ITEMS IAEI  LEFT JOIN  IT_ASSET_ITEMS AI ON AI.ITEM_ID = IAEI.ITEM_ID  LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AI.ITEM_CATEGORY_ID WHERE IAEI.EMP_ID = '" + USER_DATA_ID0 + "' AND AI.IS_ACTIVE = 'Enable' AND (AIC.ITEM_CAT_QR_PRI_CODE = 'CPU' OR AIC.ITEM_CAT_QR_PRI_CODE = 'ITD') ORDER BY AI.ITEM_ID ASC";
                di       = ExecuteBySqlString(makeItemSQL);
                dtItemID = (DataTable)di.Tables[0];
                DropDownItemID.DataSource     = dtItemID;
                DropDownItemID.DataValueField = "EMP_ITEMS_ID";
                DropDownItemID.DataTextField  = "ITEM_NAME_ALL";
                DropDownItemID.DataBind();
                DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                cmdl    = new OracleCommand(makeSQL);
                oradata = new OracleDataAdapter(cmdl.CommandText, conn);
                dt      = new DataTable();
                oradata.Fill(dt);
                GridViewItem.DataSource   = dt;
                GridViewItem.DataKeyNames = new string[] { "EMP_ITEM_EXP_ID" };
                GridViewItem.DataBind();



                for (int i = 0; GridViewItemDept.Columns.Count > i;)
                {
                    GridViewItemDept.Columns.RemoveAt(i);
                }
            }
            else
            {
                USER_DATA_ID  = Convert.ToInt32(DropDownDepartmentID.SelectedValue);
                USER_DATA_ID2 = Convert.ToInt32(DropDownDivisionID.SelectedValue);
                USER_DATA_ID3 = Convert.ToInt32(DropDownLocationID.SelectedValue);
                USER_DATA_ID4 = Convert.ToInt32(DropDownPlacementID.SelectedValue);
                makeSQL       = " select AEIE.*, AIE.ITEM_EXP_NAME, (EXTRACT (DAY FROM (AEIE.EXPIRES_DATE-SYSDATE)))  AS EXPIRED_DAYS_BET,  AEIE.EXPIRED_DAYS , AEIE.IS_ACTIVE, IAIP.PLACEMENT_NAME from IT_ASSET_EMP_ITEM_EXPIRES AEIE left join IT_ASSET_ITEM_EXPIRES AIE ON AIE.ITEM_EXP_ID = AEIE.ITEM_EXP_ID left join IT_ASSET_ITEMS_PLACEMENT IAIP ON IAIP.PLACEMENT_ID = AEIE.PLACEMENT_ID  where AEIE.DEPARTMENT_ID = '" + USER_DATA_ID + "' AND AEIE.DIVISION_ID = '" + USER_DATA_ID2 + "' AND AEIE.LOCATION_ID = '" + USER_DATA_ID3 + "' AND AEIE.PLACEMENT_ID = '" + USER_DATA_ID4 + "' order by AEIE.EMP_ITEM_EXP_ID";

                string makeItemSQL = " SELECT IAEI.EMP_ITEMS_ID, AI.ITEM_NAME || ' - ' || AI.ITEM_TYPE || ' ' || AI.ITEM_BRAND AS ITEM_NAME_ALL from IT_ASSET_EMP_ITEMS IAEI  LEFT JOIN  IT_ASSET_ITEMS AI ON AI.ITEM_ID = IAEI.ITEM_ID  LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AI.ITEM_CATEGORY_ID WHERE IAEI.DEPARTMENT_ID = '" + USER_DATA_ID + "' AND IAEI.DIVISION_ID = '" + USER_DATA_ID2 + "' AND IAEI.LOCATION_ID = '" + USER_DATA_ID3 + "'  AND IAEI.PLACEMENT_ID = '" + USER_DATA_ID4 + "'  AND AI.IS_ACTIVE = 'Enable' AND (AIC.ITEM_CAT_QR_PRI_CODE = 'CPU' OR AIC.ITEM_CAT_QR_PRI_CODE = 'ITD') ORDER BY AI.ITEM_ID ASC";
                di       = ExecuteBySqlString(makeItemSQL);
                dtItemID = (DataTable)di.Tables[0];
                DropDownItemID.DataSource     = dtItemID;
                DropDownItemID.DataValueField = "EMP_ITEMS_ID";
                DropDownItemID.DataTextField  = "ITEM_NAME_ALL";
                DropDownItemID.DataBind();
                DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                cmdl    = new OracleCommand(makeSQL);
                oradata = new OracleDataAdapter(cmdl.CommandText, conn);
                ds      = new DataTable();
                oradata.Fill(ds);
                GridViewItemDept.DataSource   = ds;
                GridViewItemDept.DataKeyNames = new string[] { "EMP_ITEM_EXP_ID" };
                GridViewItemDept.DataBind();


                for (int i = 0; GridViewItem.Columns.Count > i;)
                {
                    GridViewItem.Columns.RemoveAt(i);
                }
            }

            DropDownItemID.Attributes.Remove("disabled");
            BtnAdd.Attributes.Add("aria-disabled", "true");
            BtnAdd.Attributes.Add("class", "btn btn-primary active");

            TextItemID.Text          = "";
            DropDownItemID.Text      = "0";
            DropDownItemExpID.Text   = "0";
            TextSerialNo.Text        = "";
            TextActivationCode.Text  = "";
            TextExpiredDays.Text     = "";
            TextStartExpiryDate.Text = "";
            conn.Close();
            alert_box.Visible = false;
        }
Exemplo n.º 9
0
        protected void linkSelectClick(object sender, EventArgs e)
        {
            OracleConnection conn = new OracleConnection(strConnString);

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

            Session["user_page_data_id"] = btn.CommandArgument;
            string USER_DATA_ID = Session["user_page_data_id"].ToString();

            DataTable dtUserTypeID = new DataTable();
            DataSet   ds           = new DataSet();
            string    makeSQL      = " select * from IT_ASSET_EMP_ITEM_EXPIRES where EMP_ITEM_EXP_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++)
            {
                TextItemExpID.Text     = dt.Rows[i]["EMP_ITEM_EXP_ID"].ToString();
                DropDownItemExpID.Text = dt.Rows[i]["ITEM_EXP_ID"].ToString();

                if (radExpSelect.SelectedValue == "Employee")
                {
                    DataTable dtItemID    = new DataTable();
                    DataSet   di          = new DataSet();
                    string    makeItemSQL = " SELECT IAEI.EMP_ITEMS_ID, AI.ITEM_NAME || ' - ' || AI.ITEM_TYPE || ' ' || AI.ITEM_BRAND AS ITEM_NAME_ALL from IT_ASSET_EMP_ITEMS IAEI  LEFT JOIN  IT_ASSET_ITEMS AI ON AI.ITEM_ID = IAEI.ITEM_ID LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AI.ITEM_CATEGORY_ID WHERE AI.IS_ACTIVE = 'Enable' AND IAEI.EMP_ID = '" + dt.Rows[i]["EMP_ID"].ToString() + "' AND (AIC.ITEM_CAT_QR_PRI_CODE = 'CPU' OR AIC.ITEM_CAT_QR_PRI_CODE = 'ITD') ORDER BY AI.ITEM_ID ASC";
                    di       = ExecuteBySqlString(makeItemSQL);
                    dtItemID = (DataTable)di.Tables[0];
                    DropDownItemID.DataSource     = dtItemID;
                    DropDownItemID.DataValueField = "EMP_ITEMS_ID";
                    DropDownItemID.DataTextField  = "ITEM_NAME_ALL";
                    DropDownItemID.DataBind();
                    DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                    DropDownItemID.Text     = dt.Rows[i]["ITEM_ID"].ToString();
                    DropDownEmployeeID.Text = dt.Rows[i]["EMP_ID"].ToString();
                }
                else
                {
                    DropDownDepartmentID.Text = dt.Rows[i]["DEPARTMENT_ID"].ToString();
                    DropDownDivisionID.Text   = dt.Rows[i]["DIVISION_ID"].ToString();
                    DropDownLocationID.Text   = dt.Rows[i]["LOCATION_ID"].ToString();
                    DropDownPlacementID.Text  = dt.Rows[i]["PLACEMENT_ID"].ToString();

                    string    makeItemSQL = " SELECT IAEI.EMP_ITEMS_ID, AI.ITEM_ID, AI.ITEM_NAME || ' - ' || AI.ITEM_TYPE || ' ' || AI.ITEM_BRAND AS ITEM_NAME_ALL from IT_ASSET_EMP_ITEMS IAEI LEFT JOIN IT_ASSET_ITEMS AI ON IAEI.ITEM_ID = AI.ITEM_ID LEFT JOIN IT_ASSET_ITEM_CATEGORIES AIC ON AIC.ITEM_CATEGORY_ID = AI.ITEM_CATEGORY_ID WHERE AI.IS_ACTIVE = 'Enable' AND IAEI.DEPARTMENT_ID = '" + dt.Rows[i]["DEPARTMENT_ID"].ToString() + "'  AND IAEI.DIVISION_ID = '" + dt.Rows[i]["DIVISION_ID"].ToString() + "' AND IAEI.LOCATION_ID = '" + dt.Rows[i]["LOCATION_ID"].ToString() + "' AND IAEI.PLACEMENT_ID = '" + dt.Rows[i]["PLACEMENT_ID"].ToString() + "' AND (AIC.ITEM_CAT_QR_PRI_CODE = 'CPU' OR AIC.ITEM_CAT_QR_PRI_CODE = 'ITD') ORDER BY AI.ITEM_ID ASC";
                    DataTable dtItemdID   = new DataTable();
                    DataSet   did         = new DataSet();
                    did       = ExecuteBySqlString(makeItemSQL);
                    dtItemdID = (DataTable)did.Tables[0];
                    DropDownItemID.DataSource     = dtItemdID;
                    DropDownItemID.DataValueField = "EMP_ITEMS_ID";
                    DropDownItemID.DataTextField  = "ITEM_NAME_ALL";
                    DropDownItemID.DataBind();
                    DropDownItemID.Items.Insert(0, new ListItem("Select  Item", "0"));

                    DropDownItemID.Text = dt.Rows[i]["ITEM_ID"].ToString();
                }
                TextSerialNo.Text       = dt.Rows[i]["SERIAL_NO"].ToString();
                TextActivationCode.Text = dt.Rows[i]["ACTIVATION_CODE"].ToString();
                DateTime StartDateTemp  = DateTime.ParseExact(dt.Rows[i]["START_DATE"].ToString(), "M/d/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
                string   StartDate      = String.Format("{0:dd/MM/yyyy h:mm:ss tt}", StartDateTemp);
                DateTime ExpiryDateTemp = DateTime.ParseExact(dt.Rows[i]["EXPIRES_DATE"].ToString(), "M/d/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
                string   ExpiryDate     = String.Format("{0:dd/MM/yyyy h:mm:ss tt}", ExpiryDateTemp);
                TextStartExpiryDate.Text = StartDate + " - " + ExpiryDate;
                TextExpiredDays.Text     = dt.Rows[i]["EXPIRED_DAYS"].ToString();
                CheckIsActive.Checked    = Convert.ToBoolean(dt.Rows[i]["IS_ACTIVE"].ToString() == "Enable" ? true : false);
            }

            conn.Close();
            //     Display();
            alert_box.Visible = false;
            BtnAdd.Attributes.Add("aria-disabled", "false");
            BtnAdd.Attributes.Add("class", "btn btn-primary disabled");

            //    GridViewItem.UseAccessibleHeader = true;
            //     GridViewItem.HeaderRow.TableSection = TableRowSection.TableHeader;
            //   TextQrImage.Visible = true;

            // PlaceHolder1.Text = USER_DATA_ID;
        }