Esempio n. 1
0
        private void BindItemListStore(int StoreId)
        {
            try
            {
                chkItemList.DataSource = null;
                IMasterList objItemlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
                DataSet     theDS       = objItemlist.GetItemListStore(StoreId);
                theItemListDT = theDS.Tables[0];
                theItemList   = theDS.Tables[1];
                BindFunctions theBind = new BindFunctions();
                theBind.Win_BindCheckListBox(chkItemList, theItemListDT, "ItemName", "ItemID");

                if (theItemList.Rows.Count > 0 && StoreId > 0)
                {
                    for (int j = 0; j < theItemList.Rows.Count; j++)
                    {
                        for (int i = 0; i < theItemListDT.Rows.Count; i++)
                        {
                            if (Convert.ToInt32(theItemListDT.Rows[i]["ItemID"]) == Convert.ToInt32(theItemList.Rows[j]["ItemID"]))
                            {
                                this.chkItemList.SetItemChecked(i, true);
                            }
                        }
                    }
                }
                bool IsAllcheck = true;
                for (int i = 0; i < chkItemList.Items.Count; i++)
                {
                    if (chkItemList.GetItemChecked(i) == false)
                    {
                        IsAllcheck = false;
                        break;
                    }
                }
                chkAll.Checked = IsAllcheck;
            }

            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this);
            }
        }