private bool FillProductionCombo() { ddProductions.Items.Clear(); ddProductions.Items.Add(new ListItem("None", "0")); CCDBaccess db = new CCDBaccess(); string errmsg = ""; ProdList prodList = new ProdList(); if (db.GetAllowedProductions(ref prodList, out errmsg) == false) { lblError.Text = errmsg; return(false); } Session["AllowProductions"] = prodList; foreach (ProdItem item in prodList) { ddProductions.Items.Add(new ListItem(string.Format("{0} {1:00}-{2:00}-{3:0000}", Globals.GetNameFromID("PublicationNameCache", item.publicationID), item.pubDate.Day, item.pubDate.Month, item.pubDate.Year), item.productionID.ToString())); } return(true); }
private void btnAddToMessage_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; string msg = ""; int nID = Globals.TryParse(lblMessageID.Text, 0); if (nID != 0) { msg = "\r\n--------------------------------------------------------\r\n" + LblEventTime.Text + ":\r\n" + txtMessage.Text; } DateTime pubDate = DateTime.Now; int publicationID = 0; if (ddProductions.SelectedValue != "0") { int productionID = Globals.TryParse(ddProductions.SelectedValue, 0); ProdList prodList = (ProdList)Session["AllowProductions"]; if (prodList != null) { prodList.FindPubAndPubDate(productionID, out publicationID, out pubDate); } } db.UpdateMessage(nID, (string)Session["UserName"], txtTo.Text, txtSubject.Text, msg, RadioButtonListPrio.SelectedIndex == 1, pubDate, publicationID, out errmsg); panelFields.Visible = false; btnNewMessage.Visible = true; GetAllMessages(); }
public override bool UndoMethod(object obj) { TMain = new TrnMain { VoucherName = "Purchase Invoice", VoucherPrefix = "PI" }; if (ProdList != null) { ProdList.Clear(); } TMain.PropertyChanged += TMain_PropertyChanged; NewShipment = false; return(false); }
public void ReCalculateBill() { TOTAMNT = ProdList.Where(x => x.ADDTIONALROW == 0).Sum(x => x.AMOUNT); int i = 0; foreach (TrnProd prod in ProdList) { i++; prod.SNO = i; if (prod.ISVAT == 1) { prod.TAXABLE = prod.AMOUNT - prod.DISCOUNT + prod.SERVICETAX; prod.VAT = prod.TAXABLE * Settings.VatRate; prod.NONTAXABLE = 0; if (prod.REALQTY_IN == 0) { prod.NCRATE = prod.PRATE; } else { prod.NCRATE = prod.TAXABLE / prod.REALQTY_IN; } } else { prod.TAXABLE = 0; prod.VAT = 0; prod.NONTAXABLE = prod.AMOUNT - prod.DISCOUNT + prod.SERVICETAX; if (prod.REALQTY_IN == 0) { prod.NCRATE = prod.PRATE; } else { prod.NCRATE = prod.NONTAXABLE / prod.REALQTY_IN; } } prod.NETAMOUNT = prod.TAXABLE + prod.NONTAXABLE + prod.SERVICETAX + prod.VAT; } TOTAMNT = ProdList.Sum(x => x.AMOUNT); DCAMNT = ProdList.Sum(x => x.DISCOUNT); ServiceCharge = ProdList.Sum(x => x.SERVICETAX); TAXABLE = ProdList.Sum(x => x.TAXABLE); NONTAXABLE = ProdList.Sum(x => x.NONTAXABLE); VATAMNT = ProdList.Sum(x => x.VAT); NETWITHOUTROUNDOFF = ProdList.Sum(x => x.NETAMOUNT); NETAMNT = Math.Round(NETWITHOUTROUNDOFF, 2); }
private void TMain_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "REFORDBILL") { TMain = new TrnMain { VoucherName = "Purchase Invoice", VoucherPrefix = "PI", REFORDBILL = TMain.REFORDBILL }; if (ProdList != null) { ProdList.Clear(); } TMain.PropertyChanged += TMain_PropertyChanged; _action = ButtonAction.Init; } }
public ActionResult Category() { ProdList prodList = new ProdList(); for (int i = 0; i < 50; i++) { prodList.product.Add(new Product { Id = i, CatagoryId = 1, Name = "Name", Description = "Des", Price = 499, PicturePath = "../../Content/img/Cat1/Nike2.jpg" }); } if (prodList.product.Count() == 0) { return(View()); } return(View(prodList)); }
private void ProductList_Click(object sender, EventArgs e) { ProdList pl = new ProdList(); pl.Show(); }
public WonkaProductMessage(List <WonkaProduct> poProductList, bool pbPopulateMetadata = true) : this(pbPopulateMetadata) { ProdList.AddRange(poProductList); }
public WonkaProductMessage(WonkaProduct poProduct, bool pbPopulateMetadata = true) : this(pbPopulateMetadata) { ProdList.Add(poProduct); }