Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "notpass")
                {
                    Response.Write("<script>alert('لم يتم الحفظ');</script>");
                }

                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        Warehouse warehouse = new clsWarehouse().get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtName.Text = warehouse.Name;
                        ddlStoreKeeper.SelectedValue = warehouse.StoreKeeper.ToString();
                        txtWarehouseAddress.Text     = warehouse.Address;
                        btnEdit.Visible = true;
                    }
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            DataTable table = GetTable();

            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "notpass")
                {
                    Response.Write("<script>alert('لم يتم الحفظ');</script>");
                }

                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        InvProduct product = new clsProduct().get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtName.Text              = product.Name;
                        txtSerialNum.Text         = product.SerialNumber;
                        txtInitialAmount.Text     = product.StockAmount.ToString();
                        txtCost.Text              = product.Cost.ToString();
                        txtPrice.Text             = product.Price.ToString();
                        txtBarcode.Text           = product.Barcode;
                        ddlCategory.SelectedValue = product.Category.ToString();
                        txtLowQuantity.Text       = product.LowQuantity.ToString();
                        // DataTable table = GetTable();

                        for (int i = 0; i < product.productWatehouse.Count; i++)
                        {
                            Warehouse warehouse = new clsWarehouse().get(product.productWatehouse[i].WarehouseID);
                            DataRow   dr        = table.NewRow();
                            dr["WearhouseID"] = product.productWatehouse[i].WarehouseID;
                            dr["Wearhouse"]   = warehouse.Name;
                            dr["Quantity"]    = product.productWatehouse[i].Quantity;
                            dr["Cost"]        = product.productWatehouse[i].Cost;
                            dr["Price"]       = product.productWatehouse[i].Price;
                            dr["Barcode"]     = product.productWatehouse[i].Barcode;
                            table.Rows.Add(dr);
                        }
                        Session["ProductWarehouse"] = table;
                        //       Gbind();
                        grid.DataSource = table;
                        grid.DataBind();
                        btnEdit.Visible = true;
                    }
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Security
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            //else
            //{
            //    if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AddBank, Request.Cookies["user"]["Permission"].ToString()))
            //        Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
            //}

            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "notpass")
                {
                    Response.Write("<script>alert('لم يتم الحفظ');</script>");
                }

                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        Warehouse warehouse = new clsWarehouse().get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtName.Text = warehouse.Name;
                        ddlStoreKeeper.SelectedValue = warehouse.StoreKeeper.ToString();
                        txtWarehouseAddress.Text     = warehouse.Address;
                        btnSave.Visible = false;
                        btnEdit.Visible = true;
                    }
                    else
                    {
                        btnSave.Visible = true;
                        btnEdit.Visible = false;
                    }
                }
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Security
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            //else
            //{
            //    if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AddBank, Request.Cookies["user"]["Permission"].ToString()))
            //        Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
            //}
            DataTable table = GetTable();

            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "notpass")
                {
                    Response.Write("<script>alert('لم يتم الحفظ');</script>");
                }

                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        InvProduct product = new clsProduct().get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtName.Text              = product.Name;
                        txtSerialNum.Text         = product.SerialNumber;
                        txtInitialAmount.Text     = product.StockAmount.ToString();
                        txtCost.Text              = product.Cost.ToString();
                        txtPrice.Text             = product.Price.ToString();
                        txtBarcode.Text           = product.Barcode;
                        ddlCategory.SelectedValue = product.Category.ToString();
                        txtLowQuantity.Text       = product.LowQuantity.ToString();
                        // DataTable table = GetTable();

                        for (int i = 0; i < product.productWatehouse.Count; i++)
                        {
                            Warehouse warehouse = new clsWarehouse().get(product.productWatehouse[i].WarehouseID);
                            DataRow   dr        = table.NewRow();
                            dr["WearhouseID"] = product.productWatehouse[i].WarehouseID;
                            dr["Wearhouse"]   = warehouse.Name;
                            dr["Quantity"]    = product.productWatehouse[i].Quantity;
                            dr["Cost"]        = product.productWatehouse[i].Cost;
                            dr["Price"]       = product.productWatehouse[i].Price;
                            dr["Barcode"]     = product.productWatehouse[i].Barcode;
                            table.Rows.Add(dr);
                        }
                        Session["ProductWarehouse"] = table;
                        //       Gbind();
                        btnSave.Visible = false;
                        btnEdit.Visible = true;
                    }
                    else
                    {
                        //  table = GetTable();
                        btnSave.Visible = true;
                        btnEdit.Visible = false;
                    }
                }
            }
        }