private void BindSupplier()
 {
     DropDownListSupplier.DataSource     = ClaimSupplier.GetClaimSupplierList();
     DropDownListSupplier.DataTextField  = "Description";
     DropDownListSupplier.DataValueField = "ClaimSupplierId";
     DropDownListSupplier.DataBind();
     DropDownListSupplier.Items.Insert(0, new ListItem("Please select", "0"));
 }
        private void BindSupplierList()
        {
            DropDownListSupplier.DataSource     = Barcode.GetBarcodeSupplierList(companyId);
            DropDownListSupplier.DataTextField  = "Supplier";
            DropDownListSupplier.DataValueField = "Supplier";
            DropDownListSupplier.DataBind();

            DropDownListSupplier.Items.Insert(0, new ListItem("All", "All"));
        }
Example #3
0
        //Shijun
        protected void Page_Load(object sender, EventArgs e)
        {   //Get the item code
            if (Request.QueryString["itemid"] != null)
            {
                itemid = Request.QueryString["itemid"];
            }
            if (Session["Employee"] != null)
            {
                int employeeid = (int)Session["Employee"];
                user = BusinessLogic.GetEmployeeById(employeeid);
            }
            else
            {
                Response.Redirect(ResolveUrl("~"));
            }

            if (!IsPostBack)
            {
                //Binding the supplier to a dropdownlist to the item selected
                DropDownListSupplier.DataSource     = BusinessLogic.GetSupplier(itemid);
                DropDownListSupplier.DataTextField  = "supplier_name";
                DropDownListSupplier.DataValueField = "supplier_id";
                DropDownListSupplier.DataBind();

                //Getting an object of the item selected and passed it to the web
                inventory itemSelected = BusinessLogic.GetInventory(itemid);
                itemNumber.Text       = itemSelected.item_number;
                itemDescription.Text  = itemSelected.description;
                itemCurrentStock.Text = itemSelected.current_quantity.ToString();
                if ((itemSelected.reorder_level - itemSelected.current_quantity) <= 0)
                {
                    TextBoxOrderQuantity.Text = itemSelected.reorder_quantity.ToString();
                }
                else
                {
                    TextBoxOrderQuantity.Text = (itemSelected.reorder_level - itemSelected.current_quantity).ToString();
                }
                //Getting the user from the session and the current time to be posted on the webpage
                createByWho.Text = user.employee_name;
                DateTime dateAndTime = DateTime.Now;
                createOnWhen.Text      = dateAndTime.ToString("dd-MM-yyyy");
                LabelRequiredDate.Text = dateAndTime.AddDays(28).ToString("dd-MM-yyyy");

                //When dropdownlist change, change the unit price and change the total price based on the quantity
                CalculationForUnitCostAndTotalCost(Convert.ToInt32(TextBoxOrderQuantity.Text));
            }
        }
 private void BindSupplier()
 {
     DropDownListSupplier.Items.Insert(0, new ListItem("Please select", "0"));
     //Supplier Name Change
     DropDownListSupplier.Items.Insert(1, new ListItem("Monteagle Dairies(Honeydew)", "1"));
     DropDownListSupplier.Items.Insert(2, new ListItem("Fairfield", "2"));
     DropDownListSupplier.Items.Insert(3, new ListItem("Monteagle Africa", "3"));
     DropDownListSupplier.Items.Insert(4, new ListItem("Monteagle Consumer", "4"));
     DropDownListSupplier.Items.Insert(5, new ListItem("Woodlands", "5"));
     DropDownListSupplier.Items.Insert(6, new ListItem("DC", "6"));
     DropDownListSupplier.Items.Insert(7, new ListItem("BiscoPlus", "7"));
     DropDownListSupplier.Items.Insert(8, new ListItem("Smart Chef", "8"));
     DropDownListSupplier.Items.Insert(9, new ListItem("Chicka Chicken", "9"));
     DropDownListSupplier.Items.Insert(10, new ListItem("Maltons", "10"));
     DropDownListSupplier.Items.Insert(11, new ListItem("Other", "11"));
     DropDownListSupplier.DataBind();
 }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
            {
                PenggunaLogin pengguna = (PenggunaLogin)Session["PenggunaLogin"];
                TextBoxTanggal.Text = DateTime.Now.ToString("d MMMM yyyy");

                DropDownListSupplier.DataSource     = db.TBSuppliers.OrderBy(item => item.Nama).ToArray();
                DropDownListSupplier.DataTextField  = "Nama";
                DropDownListSupplier.DataValueField = "IDSupplier";
                DropDownListSupplier.DataBind();
                DropDownListSupplier.Items.Insert(0, new ListItem {
                    Text = "-Pilih Supplier-", Value = "0"
                });

                DropDownListPenerimaan.Items.Insert(0, new ListItem {
                    Text = "-Tanpa Penerimaan-", Value = "-"
                });

                TBStokBahanBaku[] daftarStokBahanBaku = db.TBStokBahanBakus.Where(item => item.IDTempat == pengguna.IDTempat).ToArray();
                DropDownListStokBahanBaku.DataSource     = daftarStokBahanBaku.Select(item => new { item.IDStokBahanBaku, item.TBBahanBaku.Nama }).OrderBy(item => item.Nama).ToArray();
                DropDownListStokBahanBaku.DataTextField  = "Nama";
                DropDownListStokBahanBaku.DataValueField = "IDStokBahanBaku";
                DropDownListStokBahanBaku.DataBind();

                if (DropDownListStokBahanBaku.Items.Count == 0)
                {
                    ButtonSimpanDetail.Enabled = false;
                    ButtonSimpan.Enabled       = false;
                }
                else
                {
                    TBStokBahanBaku stokBahanBaku = daftarStokBahanBaku.FirstOrDefault(item => item.IDStokBahanBaku == DropDownListStokBahanBaku.SelectedValue.ToInt());
                    TextBoxHarga.Text = (stokBahanBaku.HargaBeli.Value * stokBahanBaku.TBBahanBaku.Konversi.Value).ToFormatHarga();
                    LabelSatuan.Text  = "/" + stokBahanBaku.TBBahanBaku.TBSatuan1.Nama;
                }
                ViewState["ViewStateListDetail"] = new List <StokBahanBaku_Model>();
            }
        }
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
            {
                PenggunaLogin pengguna = (PenggunaLogin)Session["PenggunaLogin"];
                TextBoxPegawai.Text = pengguna.NamaLengkap;
                TextBoxTanggal.Text = DateTime.Now.ToString("d MMMM yyyy");

                DropDownListSupplier.DataSource     = db.TBSuppliers.OrderBy(item => item.Nama).ToArray();
                DropDownListSupplier.DataTextField  = "Nama";
                DropDownListSupplier.DataValueField = "IDSupplier";
                DropDownListSupplier.DataBind();
                DropDownListSupplier.Items.Insert(0, new ListItem {
                    Text = "-Pilih Supplier-", Value = "0"
                });
            }
        }
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
            {
                PenggunaLogin pengguna = (PenggunaLogin)Session["PenggunaLogin"];
                TextBoxIDProyeksi.Text        = string.Empty;
                TextBoxPegawai.Text           = pengguna.NamaLengkap;
                TextBoxTanggal.Text           = DateTime.Now.ToString("d MMMM yyyy");
                TextBoxTanggalJatuhTempo.Text = DateTime.Now.ToString("d MMMM yyyy");
                TextBoxTanggalPengiriman.Text = DateTime.Now.ToString("d MMMM yyyy");

                Pengguna dmPengguna = new Pengguna();
                DropDownListPenggunaPIC.DataSource     = dmPengguna.CariBawahanSemua(db.TBPenggunas.FirstOrDefault(item => item.IDPengguna == pengguna.IDPengguna)).OrderBy(item => item.LevelJabatan).ThenBy(item => item.NamaLengkap);
                DropDownListPenggunaPIC.DataTextField  = "NamaLengkap";
                DropDownListPenggunaPIC.DataValueField = "IDPengguna";
                DropDownListPenggunaPIC.DataBind();
                DropDownListPenggunaPIC.Items.Insert(0, new ListItem {
                    Text = pengguna.NamaLengkap, Value = pengguna.IDPengguna.ToString()
                });

                DropDownListSupplier.DataSource     = db.TBSuppliers.OrderBy(item => item.Nama).ToArray();
                DropDownListSupplier.DataTextField  = "Nama";
                DropDownListSupplier.DataValueField = "IDSupplier";
                DropDownListSupplier.DataBind();
                DropDownListSupplier.Items.Insert(0, new ListItem {
                    Text = "-Pilih Supplier-", Value = "0"
                });

                ViewState["ViewStateListDetail"] = new List <POProduksiDetail_Model>();

                if (!string.IsNullOrEmpty(Request.QueryString["baru"]))
                {
                    LoadPOLama(db, Request.QueryString["baru"]);
                }
                else if (!string.IsNullOrEmpty(Request.QueryString["edit"]))
                {
                    LoadPOLama(db, Request.QueryString["edit"]);
                }
                else if (!string.IsNullOrEmpty(Request.QueryString["proy"]))
                {
                    LoadProyeksi(db, Request.QueryString["proy"]);
                }
                else
                {
                    TBStokBahanBaku[] daftarStokBahanBaku = db.TBStokBahanBakus.Where(item => item.IDTempat == pengguna.IDTempat).ToArray();
                    DropDownListStokBahanBaku.DataSource     = daftarStokBahanBaku.Select(item => new { item.IDStokBahanBaku, item.TBBahanBaku.Nama }).OrderBy(item => item.Nama).ToArray();
                    DropDownListStokBahanBaku.DataTextField  = "Nama";
                    DropDownListStokBahanBaku.DataValueField = "IDStokBahanBaku";
                    DropDownListStokBahanBaku.DataBind();

                    if (DropDownListStokBahanBaku.Items.Count == 0)
                    {
                        ButtonSimpanDetail.Enabled = false;
                        ButtonSimpan.Enabled       = false;
                    }
                    else
                    {
                        LabelSatuan.Text = "/" + daftarStokBahanBaku.FirstOrDefault(item => item.IDStokBahanBaku == DropDownListStokBahanBaku.SelectedValue.ToInt()).TBBahanBaku.TBSatuan1.Nama;
                    }
                }
            }
        }
    }