Exemple #1
0
    private void LoadValue()
    {
        if (!string.IsNullOrEmpty(Request.QueryString["type"]))
        {
            hidtype.Text = Request.QueryString["type"];
            //if (hidtype.Text == "Arrivial" || hidtype.Text == "Delivery" || hidtype.Text == "Storage")
            //{
            //    hidtype.Text = "Common";
            //}
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
        {
            hidID.Text = Request.QueryString["ID"];
        }

        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Print_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "PrintList")
            .Append("prt_STAT", FSecurityHelper.CurrentUserDataGET()[12]).Append("prt_ReportCode", Request.QueryString["type"]).Append("prt_sys", "OI")
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            CmbPrint1.DataSource     = ds.Tables[0];
            CmbPrint1.DataTextField  = "text";
            CmbPrint1.DataValueField = "value";
            CmbPrint1.DataBind();
        }
        if (ds != null && ds.Tables[1].Rows.Count > 0)
        {
            CmbPrint1.Text = ds.Tables[1].Rows[0][0].ToString();
        }
        if (ds != null && ds.Tables[2].Rows.Count > 0)
        {
            hidtop.Text    = ds.Tables[2].Rows[0][0].ToString();
            hidbottom.Text = ds.Tables[2].Rows[0][1].ToString();
            hidleft.Text   = ds.Tables[2].Rows[0][2].ToString();
            hidright.Text  = ds.Tables[2].Rows[0][3].ToString();
        }
        if (ds != null && ds.Tables[3].Rows.Count > 0)
        {
            cmbPrintCount1.DataSource     = ds.Tables[3];
            cmbPrintCount1.DataValueField = "value";
            cmbPrintCount1.DataTextField  = "text";
            cmbPrintCount1.DataBind();
        }
        if (ds != null && ds.Tables.Count > 4)
        {
            if (ds.Tables[4].Rows.Count > 0)
            {
                cmbPrintCount1.Text = ds.Tables[4].Rows[0][0].ToString();
            }
        }
        if (hidtype.Text.ToUpper() == "INVOICE")
        {
            DataSet ckDs = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List <IFields>()
            {
                dal.CreateIFields().
                Append("Option", "CheckDetailData").
                Append("inv_seed", hidID.Text)
            }).GetList();
            if (ckDs.Tables[0].Rows[0][0].ToString() == "N")
            {
                LinBtnPDF.Disabled   = true;
                LinBtnPrint.Disabled = true;
            }
            else
            {
                LinBtnPDF.Disabled   = false;
                LinBtnPrint.Disabled = false;
            }


            DataSet dsInv = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List <IFields>()
            {
                dal.CreateIFields().
                Append("Option", "CheckInvoiceNo").
                Append("inv_seed", hidID.Text)
            }).GetList();
            showBtnDraft.Visible = true;
            if (dsInv.Tables[0].Rows[0][0].ToString() == "Y")
            {
                chkFlagDraft.Checked  = false;
                chkFlagDraft.Disabled = true;
                btnInvDraft.Disabled  = true;
            }
        }
    }
    private void LoadValue()
    {
        hdraft = "";
        if (!string.IsNullOrEmpty(Request.QueryString["type"]))
        {
            hidtype.Text = Request.QueryString["type"];
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
        {
            hidID.Text = Request.QueryString["ID"];
        }
        if (Request["HType"] != null)
        {
            hdraft = Request.QueryString["HType"];
            lbltishi.Hide();
            btnPrint.Show();
            btnDraft.Show();
            btnACI.Show();
            if (!string.IsNullOrEmpty(Request.QueryString["HAttach"]))
            {
                if (Request["HAttach"] == "1")
                {
                    btnAttachList.Show();
                }
                else
                {
                    btnAttachList.Hide();
                }
            }
        }
        else
        {
            btnPrint.Hide();
            btnDraft.Hide();
            btnACI.Hide();
            btnAttachList.Hide();
        }
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Print_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "PrintList")
            .Append("prt_STAT", FSecurityHelper.CurrentUserDataGET()[12]).Append("prt_ReportCode", Request.QueryString["type"]).Append("prt_sys", "OE")
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            Store2.DataSource = ds.Tables[0];
            Store2.DataBind();

            CmbPrint1.DataSource     = ds.Tables[0];
            CmbPrint1.DataTextField  = "text";
            CmbPrint1.DataValueField = "value";
            CmbPrint1.DataBind();
        }
        if (ds != null && ds.Tables[1].Rows.Count > 0)
        {
            CmbPrint.SelectedItem.Value = ds.Tables[1].Rows[0][0].ToString();
            CmbPrint1.Text = ds.Tables[1].Rows[0][0].ToString();
        }
        if (ds != null && ds.Tables[2].Rows.Count > 0)
        {
            hidtop.Text    = ds.Tables[2].Rows[0][0].ToString();
            hidbottom.Text = ds.Tables[2].Rows[0][1].ToString();
            hidleft.Text   = ds.Tables[2].Rows[0][2].ToString();
            hidright.Text  = ds.Tables[2].Rows[0][3].ToString();
        }
        if (ds != null && ds.Tables.Count > 3)
        {
            storeCopies.DataSource = ds.Tables[3];
            storeCopies.DataBind();

            cmbPrintCount1.DataSource     = ds.Tables[3];
            cmbPrintCount1.DataValueField = "value";
            cmbPrintCount1.DataTextField  = "text";
            cmbPrintCount1.DataBind();
        }
        if (ds != null && ds.Tables.Count > 4)
        {
            if (ds.Tables[4].Rows.Count > 0)
            {
                cmbPrintCount.SelectedItem.Value = ds.Tables[4].Rows[0][0].ToString();
                cmbPrintCount1.Text = ds.Tables[4].Rows[0][0].ToString();
            }
        }
        if (hidtype.Text.ToUpper() == "INVOICE")
        {
            DataSet ckDs = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List <IFields>()
            {
                dal.CreateIFields().
                Append("Option", "CheckDetailData").
                Append("inv_seed", hidID.Text)
            }).GetList();
            if (ckDs.Tables[0].Rows[0][0].ToString() == "N")
            {
                LinBtnPDF.Visible   = false;
                LinBtnPrint.Visible = false;
            }
            else
            {
                LinBtnPDF.Visible   = true;
                LinBtnPrint.Visible = true;
            }
        }
    }