void GetBalance()
    {
        string distid  = ddldistrict.SelectedValue;
        string issueid = ddlissue.SelectedValue;
        string mcomid  = ddlcomdty.SelectedValue;
        string mscheme = ddlscheme.SelectedValue;
        string source  = ddlsarrival.SelectedValue;
        string godown  = ddlgodown.SelectedValue;

        comdtobj = new Commodity_MP(ComObj);
        string  qry = "Select Round(Sum(Current_Balance),5) as Current_Balance  from dbo.issue_opening_balance where District_Id='" + distid + "'and Depotid='" + sid + "'and Commodity_Id='" + mcomid + "'and Scheme_Id='" + mscheme + "' and Source='" + source + "' and Godown='" + godown + "'";
        DataSet ds  = comdtobj.selectAny(qry);

        if (ds.Tables[0].Rows.Count == 0)
        {
            Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('There is No opening for selected  comodity....'); </script> ");
            lblbalqty.Visible = false;
            txtbalqty.Visible = false;
            lblqtls.Visible   = false;
        }
        else
        {
            DataRow dr = ds.Tables[0].Rows[0];
            txtbalqty.Text      = dr["Current_Balance"].ToString();
            lblbalqty.Visible   = true;
            txtbalqty.Visible   = true;
            lblqtls.Visible     = true;
            txtbalqty.BackColor = System.Drawing.Color.Wheat;
            txtbalqty.ReadOnly  = true;
        }
    }
 void GetStackPos()
 {
     if (ddlstack.SelectedItem.Text == "--Select--")
     {
         txtmaxcap.Text = "00.00000";
         txtcurcap.Text = "00.00000";
     }
     else
     {
         string gid     = ddlgodown.SelectedValue;
         string stackid = ddlstack.SelectedValue;
         comdtobj = new Commodity_MP(ComObjWlC);
         string  qryspos = "SELECT tbl_MetaData_STACK.Stack_capacity,tbl_storage_Stacking_Details.Weight FROM dbo.tbl_MetaData_STACK left join dbo.tbl_storage_Stacking_Details on tbl_MetaData_STACK.Godown_ID=tbl_storage_Stacking_Details.Godown_ID and tbl_MetaData_STACK.Stack_ID=tbl_storage_Stacking_Details.Stack_ID where tbl_MetaData_STACK.District_Id='" + did + "' and tbl_MetaData_STACK.DepotId='" + sid + "'and tbl_MetaData_STACK.Godown_ID='" + gid + "'and tbl_MetaData_STACK.Stack_ID='" + stackid + "'";
         DataSet ds      = comdtobj.selectAny(qryspos);
         if (ds == null)
         {
             txtmaxcap.Text = "00.00000";
             txtcurcap.Text = "00.00000";
         }
         else
         {
             DataRow dr = ds.Tables[0].Rows[0];
             txtmaxcap.Text = dr["Stack_capacity"].ToString();
             txtcurcap.Text = dr["Weight"].ToString();
             decimal avcap = decimal.Parse(txtmaxcap.Text) - decimal.Parse(txtcurcap.Text);
             txtavlcap.Text = avcap.ToString();
         }
     }
 }
    protected void ddlschemetrs_SelectedIndexChanged(object sender, EventArgs e)
    {
        string distid  = ddldistrictd.SelectedValue;;
        string issueid = ddlissued.SelectedValue;
        string mcomid  = ddlcommodityd.SelectedValue;
        string mscheme = ddlschemetrs.SelectedValue;

        comdtobj = new Commodity_MP(ComObj);
        string  qry = "Select Round(Sum(Current_Balance),5) as Current_Balance  from dbo.issue_opening_balance where District_Id='" + distid + "'and Depotid='" + issueid + "'and Commodity_Id='" + mcomid + "'and Scheme_Id='" + mscheme + "'";
        DataSet ds  = comdtobj.selectAny(qry);

        if (ds.Tables[0].Rows.Count == 0)
        {
            Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('There is No opening for selected  comodity....'); </script> ");
            lblbalqtyd.Visible = false;
            txtbalqtyd.Visible = false;
            Label2.Visible     = false;
        }
        else
        {
            DataRow dr = ds.Tables[0].Rows[0];
            txtbalqtyd.Text      = dr["Current_Balance"].ToString();
            lblbalqtyd.Visible   = true;
            txtbalqtyd.Visible   = true;
            Label2.Visible       = true;
            txtbalqtyd.BackColor = System.Drawing.Color.Wheat;
            txtbalqtyd.ReadOnly  = true;
        }
    }
    void GetCommodity()
    {
        comdtobj = new Commodity_MP(ComObj);
        DataSet ds = comdtobj.selectAll(" order by Commodity_Name  desc");

        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    void GetCategory()
    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrycat = "SELECT * FROM dbo.tbl_MetaData_STORAGE_CATEGORY";
        DataSet ds     = comdtobj.selectAny(qrycat);

        ddlcategory.DataSource     = ds.Tables[0];
        ddlcategory.DataTextField  = "Category_Name";
        ddlcategory.DataValueField = "Category_Id";
        ddlcategory.DataBind();
    }
Exemple #6
0
    void GetCommodity()
    {
        comdtobj = new Commodity_MP(ComObj);
        DataSet ds = comdtobj.selectAll(" order by Commodity_Name  desc");

        ddlcomdty.DataSource     = ds.Tables[0];
        ddlcomdty.DataTextField  = "Commodity_Name";
        ddlcomdty.DataValueField = "Commodity_Id";
        ddlcomdty.DataBind();
        // ddlcomdty.Items.Insert(0, "--Select--");
    }
    void GetDepositor()
    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrey = "select * from dbo.tbl_MetaData_DEPOSITOR where Depositor_Type='" + ddldepositortype.SelectedItem.Text + "'";
        DataSet ds   = comdtobj.selectAny(qrey);

        ddldepositor.DataSource    = ds.Tables[0];
        ddldepositor.DataTextField = "Depositor_Name";
        ddldepositor.DataBind();
        ddldepositor.Items.Insert(0, "--Select--");
    }
    void GetCommodityCS()
    {
        comdtobj = new Commodity_MP(ComObj);
        string  comd = "SELECT * FROM dbo.tbl_MetaData_STORAGE_COMMODITY order by Commodity_Name  desc";
        DataSet ds   = comdtobj.selectAny(comd);

        GridView2.DataSource = ds;
        GridView2.DataBind();

        GridView2.Columns[1].Visible = false;
    }
    void GetGodown()
    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrygodn = "SELECT Godown_ID,Godown_Name FROM dbo.tbl_MetaData_GODOWN where DistrictId='" + did + "' and DepotId='" + sid + "'";
        DataSet ds      = comdtobj.selectAny(qrygodn);

        ddlgodown.DataSource     = ds.Tables[0];
        ddlgodown.DataTextField  = "Godown_Name";
        ddlgodown.DataValueField = "Godown_ID";
        ddlgodown.DataBind();
        ddlgodown.Items.Insert(0, "--Select--");
    }
    void GetCommodity()
    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrySelect = "SELECT * FROM dbo.tbl_MetaData_STORAGE_COMMODITY order by Commodity_ID";
        DataSet ds        = comdtobj.selectAny(qrySelect);

        ddlcomdty.DataSource     = ds.Tables[0];
        ddlcomdty.DataTextField  = "Commodity_Name";
        ddlcomdty.DataValueField = "Commodity_Id";
        ddlcomdty.DataBind();
        ddlcomdty.Items.Insert(0, "--Select--");
    }
    void GetScheme()
    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrysch = "Select * from dbo.tbl_MetaData_SCHEME order by Scheme_Id ";
        DataSet ds     = comdtobj.selectAny(qrysch);

        ddlscheme.DataSource     = ds.Tables[0];
        ddlscheme.DataTextField  = "Scheme_Name";
        ddlscheme.DataValueField = "Scheme_Id";
        ddlscheme.DataBind();
        ddlscheme.Items.Insert(0, "--Select--");
    }
    void GetCommodity()
    {
        ddlcomdty.Items.Clear();
        comdtobj = new Commodity_MP(ComObj);
        string  selcom = "Select * from dbo.tbl_MetaData_STORAGE_COMMODITY where Commodity_Id in (23,17) and Status='Y' order by Commodity_Id";
        DataSet ds     = comdtobj.selectAny(selcom);

        ddlcomdty.DataSource     = ds.Tables[0];
        ddlcomdty.DataTextField  = "Commodity_Name";
        ddlcomdty.DataValueField = "Commodity_Id";
        ddlcomdty.DataBind();
        ddlcomdty.Items.Insert(0, "--Select--");
    }
    void GetVehicleType()

    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qreyvt = "select * from dbo.tbl_MetaData_Vehicle_Type order by Vehicle_Type_Id";
        DataSet ds     = comdtobj.selectAny(qreyvt);

        ddlvrhicletype.DataSource     = ds.Tables[0];
        ddlvrhicletype.DataTextField  = "Vehicle_Type";
        ddlvrhicletype.DataValueField = "Vehicle_Type_ID";
        ddlvrhicletype.DataBind();
        ddlvrhicletype.Items.Insert(0, "--Select--");
    }
    void GetDepositorType()

    {
        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrey = "select * from dbo.tbl_MetaData_Depositor_Type order by Depositor_Type_Id";
        DataSet ds   = comdtobj.selectAny(qrey);

        ddldepositortype.DataSource     = ds.Tables[0];
        ddldepositortype.DataTextField  = "Depositor_Type";
        ddldepositortype.DataValueField = "Depositor_Type_Id";
        ddldepositortype.DataBind();
        ddldepositortype.Items.Insert(0, "--Select--");
    }
    void GetStack()
    {
        string gid = ddlgodown.SelectedValue;

        comdtobj = new Commodity_MP(ComObjWlC);
        string  qrystack = "SELECT Stack_ID,Stack_Name FROM dbo.tbl_MetaData_STACK where District_Id='" + did + "' and DepotId='" + sid + "'and Godown_ID='" + gid + "'";
        DataSet ds       = comdtobj.selectAny(qrystack);

        ddlstack.DataSource     = ds.Tables[0];
        ddlstack.DataTextField  = "Stack_Name";
        ddlstack.DataValueField = "Stack_ID";
        ddlstack.DataBind();
        ddlstack.Items.Insert(0, "--Select--");
    }
    void GetCommodityT()
    {
        string com = ddlcomdty.SelectedItem.Text;

        string com1 = com.Substring(0, 4);
        string qr   = "select * from tbl_MetaData_STORAGE_COMMODITY where Commodity_Name like '%" + com1 + "%' and Status='Y' order by Commodity_Name";

        comdtobj = new Commodity_MP(ComObj);
        DataSet dst = comdtobj.selectAny(qr);

        ddlcommodityd.DataSource     = dst.Tables[0];
        ddlcommodityd.DataTextField  = "Commodity_Name";
        ddlcommodityd.DataValueField = "Commodity_Id";
        ddlcommodityd.DataBind();
        ddlcommodityd.Items.Insert(0, "--Select--");
    }
    void GetCommodity()
    {
        if (con.State == ConnectionState.Closed)
        {
            con.Open();
        }

        comdtobj = new Commodity_MP(ComObj);
        DataSet ds = comdtobj.selectAll(" order by Commodity_Name  desc");

        ddlcomdty.DataSource     = ds.Tables[0];
        ddlcomdty.DataTextField  = "Commodity_Name";
        ddlcomdty.DataValueField = "Commodity_Id";
        ddlcomdty.DataBind();
        ddlcomdty.Items.Insert(0, "--Select--");

        if (con.State == ConnectionState.Open)
        {
            con.Close();
        }
    }