protected void btnOK_OrderItem_Click(object sender, EventArgs e) { if (btnOK.CommandName != "cancel") { CMiniItem mini = CheckIfAnyItemDetailMissing(); if (!mini.isEmpty) { lblMessage_OrderItem.Text = "Please choose your preferred options before closing"; ShowModalDialog_OrderItem(); } else { CSalesDetail sd = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem(); if (sd.Qty == 0) { ApplicationSession.SalesMaster.CollectionSalesDetail().CleaningForItemQtyZero(); } else { //close modal dialog: ScriptManager.RegisterStartupScript(Page, Page.GetType(), "#ModalOrderItem", "$('body').removeClass('modal-open');$('.modal-backdrop').remove();", true); UpdatePanel1.Update(); } } } }
protected void btnOK_ListDetail_Click(object sender, EventArgs e) { //disini cek apakah semua selgrp sudah dipilih(?) CMiniItem mini = CheckIfAnyItemDetailMissing(); if (mini.isEmpty) { InitAndShowModalDialog_OrderItem(); } else { DisplayItemDetail(mini.ID); lblMessage_ListDetail.Text = "please choose " + string.Format("{0:#,0}", mini.Qty) + " more item(s) from this selection group"; ShowModalDialog_ListDetail(false); } }
protected void btnOK_OrderItem_Click(object sender, EventArgs e) { if (btnOK.CommandName != "cancel") { CMiniItem mini = CheckIfAnyItemDetailMissing(); if (!mini.isEmpty) { lblMessage_OrderItem.Text = "Please choose your preferred options before closing"; ShowModalPopupExtender_OrderItem(); } else { //CHECK: suka error disini PopupWindowQtyClicked(ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem(), new EventArgs()); } } }
private CMiniItem CheckIfAnyItemDetailMissing() { CMiniItem miniItem = new CMiniItem(); MySqlConnection conn = CMain.GetConnection(ApplicationSession.DBName); ItemDetailCollection col = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().ItemDetails(conn, ApplicationSession.StoreID, ApplicationSession.OutletID); int lbound = col.LBoundIndex(); int ubound = col.UBoundIndex(); for (int grp = lbound; grp <= ubound; grp++) { List <CItemDetail> lst = col.ListBySelectionGroup(grp); decimal dTotItem = TotalItem_oneGroup(lst); decimal dRmnQty = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().Qty - dTotItem; if (dRmnQty > 0) { miniItem = new CMiniItem(grp, "", dRmnQty, 0); break; } } return(miniItem); }