Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["LoginCom"] != null && Session["LoginUser"] != null)
            {
                Com_username = Session["LoginCom"].ToString();
                User         = Session["LoginUser"].ToString();

                DataTable dt = con.SelecthostProc(Com_username, "Ingredient_View_Select", null, null);
                Repeater_items.DataSource = dt;
                Repeater_items.DataBind();

                DataTable dtcountingred = con.SelecthostProc(Com_username, "Count_Ingred", null, null);
                if (dtcountingred.Rows.Count > 0)
                {
                    Label_ingred.Text = dtcountingred.Rows[0][0].ToString();
                }

                DataTable dtcountbatch = con.SelecthostProc(Com_username, "Count_Batch", null, null);
                if (dtcountingred.Rows.Count > 0)
                {
                    Label_batch.Text = dtcountbatch.Rows[0][0].ToString();
                }

                DataTable dtcountrecipe = con.SelecthostProc(Com_username, "Count_Recipe", null, null);
                if (dtcountingred.Rows.Count > 0)
                {
                    Label_recipe.Text = dtcountrecipe.Rows[0][0].ToString();
                }
            }
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                if (Session["LoginCom"] != null && Session["LoginUser"] != null)
                {
                    Com_username = Session["LoginCom"].ToString();
                    User         = Session["LoginUser"].ToString();

                    DataTable dt = con.SelecthostProc(Com_username, "Ingredient_View_Select", null, null);
                    Repeater_items.DataSource = dt;
                    Repeater_items.DataBind();

                    DataTable dtcountingred = con.SelecthostProc(Com_username, "Count_Ingred", null, null);
                    if (dtcountingred.Rows.Count > 0)
                    {
                        Label_ingred.Text = dtcountingred.Rows[0][0].ToString();
                    }

                    DataTable dtcountbatch = con.SelecthostProc(Com_username, "Count_Batch", null, null);
                    if (dtcountingred.Rows.Count > 0)
                    {
                        Label_batch.Text = dtcountbatch.Rows[0][0].ToString();
                    }

                    DataTable dtcountrecipe = con.SelecthostProc(Com_username, "Count_Recipe", null, null);
                    if (dtcountingred.Rows.Count > 0)
                    {
                        Label_recipe.Text = dtcountrecipe.Rows[0][0].ToString();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            con.ExcutehostProc(Com_username, "Log_Issues", new string[] { "msg", "details" }, ex.Message, "Err-ar-Default-Page_Load");
        }
    }