Пример #1
0
        protected void chkOrderSlipPrinter_CheckedChanged(Object sender, EventArgs e)
        {
            CheckBox chkOrderSlipPrinter = (CheckBox)sender;
            DataListItem item = (DataListItem)  chkOrderSlipPrinter.NamingContainer;
            
            HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList");
            Int64 iProductID = Int64.Parse(chkList.Value);

            OrderSlipPrinter orderSlipPrinter = OrderSlipPrinter.NotApplicable;
            switch (chkOrderSlipPrinter.ID)
            {
                case "chkOrderSlipPrinter1": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter1; break;
                case "chkOrderSlipPrinter2": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter2; break;
                case "chkOrderSlipPrinter3": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter3; break;
                case "chkOrderSlipPrinter4": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter4; break;
                case "chkOrderSlipPrinter5": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter5; break;
            }

            Products clsProducts = new Products();
            clsProducts.UpdateOrderSlipPrinter(iProductID, orderSlipPrinter, chkOrderSlipPrinter.Checked);
            clsProducts.CommitAndDispose();
        }
Пример #2
0
        protected void chkOrderSlipPrinterAll_CheckedChanged(Object sender, EventArgs e)
        {
            HtmlInputCheckBox chkList = null;
            CheckBox chkOrderSlipPrinterAll = (CheckBox)sender;
            CheckBox chkOrderSlipPrinter = null;
            Int64 iProductID = 0;

            Products clsProducts = new Products();
            OrderSlipPrinter orderSlipPrinter = OrderSlipPrinter.NotApplicable;
            foreach (DataListItem item in lstItem.Items)
            {
                chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                
                iProductID = Int64.Parse(chkList.Value);

                switch (chkOrderSlipPrinterAll.ID)
                {
                    case "chkOrderSlipPrinter1All": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter1; chkOrderSlipPrinter = (CheckBox)item.FindControl("chkOrderSlipPrinter1"); break;
                    case "chkOrderSlipPrinter2All": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter2; chkOrderSlipPrinter = (CheckBox)item.FindControl("chkOrderSlipPrinter2"); break;
                    case "chkOrderSlipPrinter3All": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter3; chkOrderSlipPrinter = (CheckBox)item.FindControl("chkOrderSlipPrinter3"); break;
                    case "chkOrderSlipPrinter4All": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter4; chkOrderSlipPrinter = (CheckBox)item.FindControl("chkOrderSlipPrinter4"); break;
                    case "chkOrderSlipPrinter5All": orderSlipPrinter = OrderSlipPrinter.RetailPlusOSPrinter5; chkOrderSlipPrinter = (CheckBox)item.FindControl("chkOrderSlipPrinter5"); break;
                }
                clsProducts.UpdateOrderSlipPrinter(iProductID, orderSlipPrinter, chkOrderSlipPrinterAll.Checked);
                chkOrderSlipPrinter.Checked = chkOrderSlipPrinterAll.Checked;
            }
            clsProducts.CommitAndDispose();
        }