Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                busCategories buscat = new busCategories();
                DataTable dt = new DataTable("User");
                dt = buscat.allCategories();
                GridView1.DataSource = dt;
                GridView1.DataBind();

            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                busUnitOfMeasure busuom = new busUnitOfMeasure();
                DataTable dt = new DataTable("User");
                dt = busuom.allUOM();
                this.drpUOM.Items.Clear();
                this.drpUOM.Items.Add(new ListItem("select one", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpUOM.Items.Add(new ListItem(dr["UnitOfMeasure"].ToString(), dr["ID"].ToString()));
                }
                busSizes bussize = new busSizes();

                dt = bussize.allSize();
                this.drpSize.Items.Clear();
                this.drpSize.Items.Add(new ListItem("select one", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpSize.Items.Add(new ListItem(dr["ProductSize"].ToString(), dr["ID"].ToString()));
                }
                busCategories buscat = new busCategories();

                dt = buscat.allCategories();
                this.drpCategory.Items.Clear();
                this.drpCategory.Items.Add(new ListItem("select one", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpCategory.Items.Add(new ListItem(dr["Category"].ToString(), dr["ID"].ToString()));
                }
                busProducts busProd = new busProducts();
                dt = new DataTable("User");
                dt = busProd.allProducts();
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }
Esempio n. 3
0
 private bool isUserExisting()
 {
     string userid = this.txtCategory.Text;
     busCategories buscat = new busCategories();
     Categories frmcat = new Categories();
     frmcat = buscat.isUserExisting(userid);
     //FrameWork.Employees log = busemp.isUserExisting(userid);
     if (frmcat == null)
     {
         return false;
     }
     else if (userid.Equals(frmcat.Category))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busCategories buscat = new busCategories();
            Categories frmcat = new Categories();
            frmcat.Category = this.txtCategory.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Category existing')", true);
            }
            else
            {
                buscat.insertCategory(frmcat);
            }
            DataTable dt = new DataTable("User");
            dt = buscat.allCategories();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }