Exemplo n.º 1
0
        //Item Grid Bind
        #region [Item Category Grid Bind]

        private void BindItemGrid()
        {
            try
            {
                DataSet ds = objBL.BindItemGrid_BL();
                if (ds.Tables[0].Rows.Count == 0 || ds == null)
                {
                    ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
                    GrdStock.DataSource = ds;
                    GrdStock.DataBind();
                    int columncount = GrdStock.Rows[0].Cells.Count;
                    GrdStock.Rows[0].Cells.Clear();
                    GrdStock.Rows[0].Cells.Add(new TableCell());
                    GrdStock.Rows[0].Cells[0].ColumnSpan = columncount;
                    GrdStock.Rows[0].Cells[0].Text       = "No Records Found";
                }
                else
                {
                    GrdStock.DataSource = ds;
                    GrdStock.DataBind();
                }
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
    protected void btnShow_Click(object sender, EventArgs e)
    {
        try
        {
            //if (txtBrCd.Text == "")
            //{
            //    WebMsgBox.Show("Please select branch!", this.Page); return;
            //}
            string FLAG = "";
            if (txtEntryDate.Text == "")
            {
                FLAG = "SHOWALL";
            }
            else
            {
                FLAG = "SHOWALLASONBAL";
            }

            DataTable dt = new DataTable();

            dt = CS.rptStock(FLAG: FLAG, BRCD: txtBrCd.Text.ToString(), VENDORID: TxtVendorId.Text.ToString(), PRODID: TxtProductId.Text.ToString(), ENTRYDATE: txtEntryDate.Text.ToString());

            //dt = CS.rptStock(FLAG: "SHOWALL", BRCD: txtBrCd.Text.ToString());
            GrdStock.DataSource = dt;
            GrdStock.DataBind();
        }
        catch (Exception EX)
        {
            ExceptionLogging.SendErrorToText(EX);
        }
    }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            orgId = Convert.ToInt32(Session["OrgId"]);
            if (orgId == 0)
            {
                Response.Redirect("~/CMSHome.aspx");
            }

            GrdStock.DataSource = db.Displaygrid("SELECT      tblItem.ItemCode,   tblItem.ItemName,tblCategory.CategoryName, tblItem.Stock,    tblUnit.UnitName as Unit FROM            tblItem INNER JOIN tblCategory ON tblItem.CategoryId = tblCategory.CategoryId INNER JOIN tblUnit ON tblItem.UnitId = tblUnit.UnitId WHERE        (tblItem.OrgId = '" + Convert.ToInt32(Session["OrgId"]) + "')");
            GrdStock.DataBind();/*tblItem.UserId,*/
            //BindItemGrid();
        }
Exemplo n.º 4
0
        //Grid Index Changed
        #region GrdIndexChanged

        protected void GrdStock_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                GrdStock.PageIndex = e.NewPageIndex;

                //GrdStock.DataSource = objBL.BindItemGrid_BL();
                GrdStock.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Exemplo n.º 5
0
    public void BindStock()
    {
        BookCode2 = Txtbkcode1.Text.ToString().Split(':')[0].Trim();

        // GrdStock.DataSource = StockUpdate.GetStockUpdate();
        // GrdStock.DataBind();

        //DataTable dt = new DataTable();
        //dt = Idv.Chetana.BAL.StockUpdate.GetStockUpdateRep(bookcode).Tables[0];
        //DataView dv = new DataView(dt);
        //return dv;
        GrdStock.DataSource = StockUpdate.GetStockUpdateRep(BookCode2);
        GrdStock.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] == null)
        {
            Response.Redirect("FrmLogin.aspx");
        }

        if (!IsPostBack)
        {
            txtBrCd.Text     = Session["BRCD"].ToString();
            txtBrCdName.Text = Cbr.getbrcode(txtBrCd.Text);
            DataTable dt = new DataTable();
            dt = CS.rptStock(FLAG: "SHOWALL", BRCD: txtBrCd.Text.ToString(), VENDORID: TxtVendorId.Text.ToString(), PRODID: TxtProductId.Text.ToString(), ENTRYDATE: txtEntryDate.Text.ToString());
            GrdStock.DataSource = dt;
            GrdStock.DataBind();
            //  txtBrCd.Text = Session["BRCDNAME"].ToString();
        }
    }