Esempio n. 1
0
    private Boolean isValid()
    {
        hid_FileId.Value     = "%";
        hid_SupplierId.Value = "%";

        if (dd_FileNo.SelectedValue != "0")
        {
            hid_FileId.Value = dd_FileNo.SelectedValue.ToString() + "X%";
        }

        if (dd_Supplier.SelectedValue != "0")
        {
            hid_SupplierId.Value = dd_Supplier.SelectedValue.ToString() + "X%";
        }



        CommonFunctions commonFunctions = new CommonFunctions();

        CommonFunctions.Date_Validation dv = new CommonFunctions.Date_Validation();
        if (dv.date_Validate(txt_fromDate.Text) == false)
        {
            lbl_msg.Visible = true;
            lbl_msg.Text    = "From Date is Invalid!";
            return(false);
        }
        if (dv.date_Validate(txt_toDate.Text) == false)
        {
            lbl_msg.Visible = true;
            lbl_msg.Text    = "To Date is Invalid!";
            return(false);
        }

        return(true);
    }
    private Boolean isValid()
    {
        Connection      conn = new Connection();
        CommonFunctions commonFunctions = new CommonFunctions();
        string          s_FileIdNeeded = string.Empty, returnValue = string.Empty;

        CommonFunctions.Date_Validation dv = new CommonFunctions.Date_Validation();
        if (dv.date_Validate(txtIssueDate.Text) == false)
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "BTB Issue Date Invalid!";
            return(false);
        }

        if (dd_Supplier.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Supplier Can Not Blank!";
            return(false);
        }

        if (dd_POSupplier.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Supplier(Purchase From) Can Not Blank!";
            return(false);
        }



        //if (txt_BTBNo.Text == "")
        //{
        //    lblsubmsg.Visible = true;
        //    lblsubmsg.Text = "BTB No Can Not Blank!";
        //    return false;
        //}

        if (dd_Currency.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Currency Can Not Blank!";
            return(false);
        }

        if (hid_Rownumber.Value == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "PI Grid Can Not Blank!";
            return(false);
        }

        hid_File_Id.Value = "0";
        if (dd_FileNo.SelectedValue != "0")
        {
            s_FileIdNeeded = "SELECT File_Ref_Id FROM TBL_Export_LC Where Export_LC_Id='" + dd_FileNo.SelectedValue + "'";
            returnValue    = conn.connection_DB(s_FileIdNeeded, 0, false, false, false);
            if (returnValue != GlobalVariables.g_s_connectionErrorReturnValue)
            {
                if (conn.ResultsDataSet.Tables[0] != null)
                {
                    foreach (DataRow drow in conn.ResultsDataSet.Tables[0].Rows)
                    {
                        hid_File_Id.Value = drow["File_Ref_Id"].ToString();
                    }
                }
            }
        }

        return(true);
    }