Exemplo n.º 1
0
    public void ValidateDate()
    {
        if (hiddenfildYear.Value == "")
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();

                DataTable dt = Customer_cs.Idv_Chetana_Customer_BlackList(2, "", "", 0, 0, 0, Convert.ToInt32(strFY)).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    hiddenfildYear.Value = dt.Rows[0][0].ToString();
                }
                string year = hiddenfildYear.Value;
                MaskedEditValidator1.MinimumValue        = "01/04/" + year;
                MaskedEditValidator1.MaximumValue        = "31/03/" + (Convert.ToInt32(year) + 1).ToString();
                MaskedEditValidator1.MinimumValueMessage = "Date should be greater than 01/04/" + year;
                MaskedEditValidator1.MaximumValueMessage = "Date should be less than 31/03/" + (Convert.ToInt32(year) + 1).ToString();
            }
            else
            {
                Session.Clear();
            }
        }
    }
Exemplo n.º 2
0
    public void fillReport(int ISPRINT)
    {
        if (txtRs.Text.Trim() == "")
        {
            txtRs.Text = "0";
        }

        DataTable dt   = new DataTable();
        string    date = "";

        if (ISPRINT == 1)
        {
            if (txtcustomer.Text != "")
            {
                if (txttoDate.Text != "")
                {
                    date = txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0] + "/" + txttoDate.Text.Split('/')[2];
                    Session["DATAREP"] = Customer_cs.Idv_Chetana_Customer_BlackList(0, "_C$" + txtcustomer.Text, date, Convert.ToDecimal(txtRs.Text.Trim()), Convert.ToInt32(HidFY.Value), 0, 0).Tables[0];
                }
            }
            else
            {
                if (txttoDate.Text != "")
                {
                    date = txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0] + "/" + txttoDate.Text.Split('/')[2];
                    Session["DATAREP"] = Customer_cs.Idv_Chetana_Customer_BlackList(0, "_Z$" + txtcustomer.Text, date, Convert.ToDecimal(txtRs.Text.Trim()), Convert.ToInt32(HidFY.Value), 0, Convert.ToInt32(ddlZone.SelectedValue.Trim())).Tables[0];
                }
            }
        }
        if (Session["DATAREP"] != null)
        {
            dt = (DataTable)Session["DATAREP"];
        }
        if (dt.Rows.Count > 0)
        {
            fillReport();
        }
        else
        {
            lblMessage.Visible = true;
        }
        if (ISPRINT == 1)
        {
            //crystalReport.PrintToPrinter(0, false, 0, 0);
        }
    }
    public DataSet getBlackListedCustomer(int showdata, int view)
    {
        DataSet ds = new DataSet();

        if (txtRs.Text == "")
        {
            txtRs.Text = "0";
        }
        try
        {
            string date = "";
            if (view != 1)
            {
                date = txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0] + "/" + txttoDate.Text.Split('/')[2];
            }
            ds = Customer_cs.Idv_Chetana_Customer_BlackList(view, "", date, Convert.ToDecimal(txtRs.Text.Trim()), 1, IsShowData, 0);
            lblTotalOS.Text = "Total Outstanding : " + ds.Tables[1].Rows[0][0].ToString();
        }
        catch (Exception ex)
        {
            return(ds = null);
        }
        return(ds);
    }