コード例 #1
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('-');

            DataTable dtSlipNo    = new DataTable();
            DataSet   dss         = new DataSet();
            string    makePageSQL = " SELECT PEWS.WB_SLIP_NO || '-' || PEWCI.ITEM_WEIGHT AS WB_SLIP_NO, PEWS.WB_SLIP_NO || ' - ' || PC.PARTY_ID || ' - ' || PC.PARTY_NAME || ', Container No. - ' || PEWS.CONTAINER_NO || ', Item - ' || PI.ITEM_NAME || ', Sub Item - ' || PSI.SUB_ITEM_NAME || ', Item WT(WB) -' || TO_CHAR(PEWS.ITEM_WEIGHT_WB, '999,999,999') || ', Item WT -' || TO_CHAR((PEWCI.ITEM_WEIGHT/1000), '999999.999') AS PARTY_NAME FROM PF_EXPORT_WBSLIP_CON PEWS LEFT JOIN PF_EXPORT_WBSLIP_CON_ITEM PEWCI ON PEWCI.WB_SLIP_NO = PEWS.WB_SLIP_NO LEFT JOIN PF_PARTY PC ON PC.PARTY_ID = PEWS.PARTY_ID LEFT JOIN PF_ITEM PI ON PI.ITEM_ID = PEWCI.ITEM_ID LEFT JOIN PF_SUB_ITEM PSI ON PSI.SUB_ITEM_ID = PEWCI.SUB_ITEM_ID WHERE PEWS.EXPORT_INVOICE_NO IS NULL AND PEWS.WB_SLIP_NO = '" + USER_DATA_ID[0] + "' ORDER BY PEWS.WB_SLIP_NO ASC";

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

            string makeSQL = "  SELECT PEWC.WB_SLIP_NO, PEWC.MAT_PRICE_PER_MT, PEWC.MATERIAL_AMOUNT, PEWCI.ITEM_WEIGHT, NCR.CURRENCY_RATE_ID || '-' || NCR.EXCHANGE_RATE AS CURRENCY_RATE_ID, PEWC.CURRENCY_RATE, PEWC.MATERIAL_CONVERSION_AMOUNT, PEWC.IS_ACTIVE_PRICING, PEWC.UPDATE_DATE_PRICING, PEWC.U_USER_ID_PRICING FROM PF_EXPORT_WBSLIP_CON PEWC LEFT JOIN PF_EXPORT_WBSLIP_CON_ITEM PEWCI ON PEWCI.WB_SLIP_NO = PEWC.WB_SLIP_NO LEFT JOIN  NRC_CURRENCY_RATE NCR ON NCR.CURRENCY_RATE_ID  = PEWC.CURRENCY_RATE_ID WHERE PEWC.WB_SLIP_NO = '" + USER_DATA_ID[0] + "'";

            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++)
            {
                DropDownSlipNoEx.Text       = ds.Rows[i]["WB_SLIP_NO"].ToString() + "-" + ds.Rows[i]["ITEM_WEIGHT"].ToString();
                TextTotalQty.Text           = Convert.ToString(decimal.Parse(ds.Rows[i]["ITEM_WEIGHT"].ToString()) / 1000);
                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;

            DropDownSlipNoEx.Enabled = false;
            BtnUpdate.Attributes.Add("aria-disabled", "true");
            BtnUpdate.Attributes.Add("class", "btn btn-success active");
        }
コード例 #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 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 dtCurrencyRateID = new DataTable();
                        DataSet   drs         = new DataSet();
                        string    makeRateSQL = " SELECT  NCR.CURRENCY_RATE_ID || '-' || NCR.EXCHANGE_RATE AS CURRENCY_RATE_ID,  NCS.CURRENCY_SYMBOL || ' ' ||   NCS.CURRENCY_NAME || ' - ' || NCT.CURRENCY_SYMBOL || ' ' || NCT.CURRENCY_NAME || ', Rate - ' || NCR.EXCHANGE_RATE AS CURRENCY_NAME FROM NRC_CURRENCY_RATE NCR LEFT JOIN NRC_CURRENCY NCS ON NCS.CURRENCY_ID = NCR.SOURCE_CURRENCY_ID LEFT JOIN NRC_CURRENCY NCT ON NCT.CURRENCY_ID = NCR.TARGET_CURRENCY_ID WHERE NCR.IS_ACTIVE = 'Enable' ORDER BY NCR.CURRENCY_RATE_ID ASC ";
                        drs = ExecuteBySqlString(makeRateSQL);
                        dtCurrencyRateID = (DataTable)drs.Tables[0];
                        DropDownCurrencyRateID.DataSource     = dtCurrencyRateID;
                        DropDownCurrencyRateID.DataValueField = "CURRENCY_RATE_ID";
                        DropDownCurrencyRateID.DataTextField  = "CURRENCY_NAME";
                        DropDownCurrencyRateID.DataBind();
                        DropDownCurrencyRateID.Items.Insert(0, new ListItem("Select Currency Conversion", "0"));


                        DataTable dtSlipNo    = new DataTable();
                        DataSet   dss         = new DataSet();
                        string    makePageSQL = " SELECT PEWC.WB_SLIP_NO || '-' || PEWC.ITEM_WEIGHT || '-' || PEWC.ITEM_ID AS WB_SLIP_NO,  PEWC.CONTAINER_NO || ' - ' || PEWC.WB_SLIP_NO || ' - ' || PC.PARTY_ID || ' - ' || PC.PARTY_NAME || ' ' || ', Item - ' || PI.ITEM_NAME || ', Sub Item - ' || PSI.SUB_ITEM_NAME || ', Item WT(WB) -' || TO_CHAR(PEWC.ITEM_WEIGHT_WB, '999,999,999') || ', Item WT -' || TO_CHAR((PEWC.ITEM_WEIGHT/1000), '999999.999') AS PARTY_NAME FROM PF_EXPORT_WBSLIP_CON PEWC LEFT JOIN PF_PARTY PC ON PC.PARTY_ID = PEWC.PARTY_ID LEFT JOIN PF_ITEM PI ON PI.ITEM_ID = PEWC.ITEM_ID LEFT JOIN PF_SUB_ITEM PSI ON PSI.SUB_ITEM_ID = PEWC.SUB_ITEM_ID WHERE PEWC.EXPORT_INVOICE_NO IS NULL AND PEWC.IS_ACTIVE_PRICING IS NULL ORDER BY PEWC.WB_SLIP_NO ASC";
                        dss      = ExecuteBySqlString(makePageSQL);
                        dtSlipNo = (DataTable)dss.Tables[0];
                        DropDownSlipNoEx.DataSource     = dtSlipNo;
                        DropDownSlipNoEx.DataValueField = "WB_SLIP_NO";
                        DropDownSlipNoEx.DataTextField  = "PARTY_NAME";
                        DropDownSlipNoEx.DataBind();
                        DropDownSlipNoEx.Items.Insert(0, new ListItem("Select Weight / Container", "0"));
                        //   TextExportInvoiceNo.Enabled = false;
                        Display();

                        TextTotalQty.Attributes.Add("readonly", "readonly");
                        TextTotalAmountEx.Attributes.Add("readonly", "readonly");
                        TextItemCurrencyAmount.Attributes.Add("readonly", "readonly");

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