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"));
        }
示例#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();
 }
示例#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>();
            }
        }
    }
示例#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"
                });
            }
        }
    }
示例#7
0
        private void BindClaim()
        {
            try
            {
                StoreRep.Web.Code.Claim claim = StoreRep.Web.Code.Claim.GetClaimByClaimId(this.claimId);

                /*
                 * PayStore - 0 = No
                 * PayStore - 1 = Yes
                 * PayStore - 99 = Not indicated yet
                 */
                RadioButtonPayStoreNo.Checked  = claim.PayStore == 0;
                RadioButtonPayStoreYes.Checked = claim.PayStore == 1;

                /*
                 * SupplierClaimBack - 0 = No
                 * SupplierClaimBack - 1 = Yes
                 * SupplierClaimBack - 99 = Not indicated yet
                 */
                RadioButtonClaimSupplierNo.Checked  = claim.SupplierClaimBack == 0;
                RadioButtonClaimSupplierYes.Checked = claim.SupplierClaimBack == 1;

                DropDownListSupplier.ClearSelection();
                DropDownListSupplier.Items.FindByValue(claim.ClaimSupplierId.ToString()).Selected = true;

                //BindStore();
                DropDownListStore.ClearSelection();
                DropDownListStore.Items.FindByValue(claim.StoreId.ToString()).Selected = true;

                TextBoxClaimDate.Text   = claim.FormattedClaimDateEdit.ToString();
                TextBoxClaimNumber.Text = claim.ClaimNumber;

                DropDownListClaimType.ClearSelection();
                DropDownListClaimType.Items.FindByValue(claim.ClaimTypeId.ToString()).Selected = true;

                DropDownListClaimResponsible.ClearSelection();
                DropDownListClaimResponsible.Items.FindByValue(claim.ClaimResponsibleId.ToString()).Selected = true;

                DropDownListCategory.ClearSelection();
                DropDownListCategory.Items.FindByValue(claim.ClaimSkuCategoryId.ToString()).Selected = true;
                BindClaimSkuSubCategory();
                DropDownListSubCategory.ClearSelection();
                DropDownListSubCategory.Items.FindByValue(claim.ClaimSkuSubCategoryId.ToString()).Selected = true;

                TextBoxValue.Text = claim.Value.ToString();

                //PanelQuantity.Visible = Convert.ToInt32(DropDownListClaimType.SelectedValue) == 4; //Recall

                if (Convert.ToInt32(DropDownListClaimType.SelectedValue) == 4)//Recall
                {
                    PanelBatchNumber.Visible = true;
                    TextBoxBatchNumber.Text  = claim.BatchNumber;
                }
                else
                {
                    PanelBatchNumber.Visible = true;
                    TextBoxBatchNumber.Text  = "";
                }

                TextBoxQuantity.Text = claim.Quantity.ToString();

                TextBoxComment.Text        = claim.Comment;
                TextBoxClaimReference.Text = claim.ClaimReference;

                TextBoxCaptureDate.Text = String.Format("{0:d/M/yyyy HH:mm:ss}", claim.CreatedDate);
                TextBoxCapturedBy.Text  = claim.ModifiedUser;

                if (Convert.ToInt32(DropDownListSupplier.SelectedValue) == 2) //Monteagle Africa
                {
                    PanelKeyAccount.Visible = true;
                    DropDownListKeyAccount.ClearSelection();
                    DropDownListKeyAccount.Items.FindByValue(claim.KeyAccountId.ToString()).Selected = true;
                }
                else
                {
                    PanelKeyAccount.Visible = false;
                }

                BindClaimTypeSelection();
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                for (int i = 0; i < sqlEx.Errors.Count; i++)
                {
                    LabelError.Text += (sqlEx.Errors[i].Message + "<br />");
                }
                PanelError.Visible = true;
            }
            catch (Exception exception)
            {
                LabelError.Text   += (exception.Message + "<br />");
                PanelError.Visible = true;
            }
        }
示例#8
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;
                    }
                }
            }
        }
    }