Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ddlItemType.SelectedValue.ToString() == "0")
            {
                // IQCareWindowMsgBox.ShowWindow("ItemTypeSelect", this);
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Item type";
                IQCareWindowMsgBox.ShowWindow("BlankDropDown", theBuilder, this);
                ddlItemType.Focus();
                return;
            }
            arrSubItemList = new ArrayList();
            for (int i = 0; i < chkSubItemTypeList.Items.Count; i++)
            {
                if (chkSubItemTypeList.GetItemChecked(i) == true)
                {
                    arrSubItemList.Add((((System.Data.DataRowView)(chkSubItemTypeList.Items[i])).Row.ItemArray[0]).ToString());
                }
            }
            string      ItemType      = ddlItemType.SelectedValue.ToString();
            IMasterList objMasterlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
            int         ret           = objMasterlist.SaveSubItemList(arrSubItemList, Convert.ToInt32(ddlItemType.SelectedValue), GblIQCare.AppUserId);

            theDrugTypeDT = ((DataSet)objMasterlist.GetDrugType(Convert.ToInt32(ItemType))).Tables[0];
            if (ret > 0)
            {
                IQCareWindowMsgBox.ShowWindow("ProgramSave", this);
                return;
            }
        }
Пример #2
0
        private void BindDrugTypeListByItemID(int itemID)
        {
            IMasterList objDrugTypelist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
            int         ItemTypeid      = 0;

            if (ddlItemType.SelectedIndex > 0)
            {
                ItemTypeid = Convert.ToInt32(ddlItemType.SelectedValue.ToString());
            }
            DataSet theDS = objDrugTypelist.GetDrugType(ItemTypeid);

            theDrugTypeDT = theDS.Tables[0];
            theDrugType   = theDS.Tables[1];


            DataView theDV = new DataView(theDrugTypeDT);

            theDV.RowFilter = "MapTypeId=" + itemID.ToString();
            DataTable theDT = theDV.ToTable();

            chkSubItemTypeList.DataSource = null;
            chkSubItemTypeList.Items.Clear();
            BindFunctions theBind = new BindFunctions();

            theBind.Win_BindCheckListBox(chkSubItemTypeList, theDrugType, "DrugTypeName", "DrugTypeID");
            for (int i = 0; i < theDT.Rows.Count; i++)
            {
                for (int j = 0; j < chkSubItemTypeList.Items.Count; j++)
                {
                    if (Convert.ToInt32(theDT.Rows[i]["MapTypeId"]) == itemID && theDT.Rows[i]["DrugTypeName"].ToString() == chkSubItemTypeList.GetItemText(chkSubItemTypeList.Items[j]))
                    {
                        this.chkSubItemTypeList.SetItemChecked(j, true);
                    }
                }
            }
            bool IsAllcheck = true;

            for (int i = 0; i < chkSubItemTypeList.Items.Count; i++)
            {
                if (chkSubItemTypeList.GetItemChecked(i) == false)
                {
                    IsAllcheck = false;
                    break;
                }
            }
            chktype.Checked = IsAllcheck;
        }
Пример #3
0
    protected void FillDropDowns()
    {
        try
        {
            BindFunctions BindManager       = new BindFunctions();
            IMasterList   objItemCommonlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
            DataSet       theDS             = objItemCommonlist.GetItemDetails(Convert.ToInt32(0));
            DataSet       DTItemlist        = objItemCommonlist.GetDrugType(0);

            BindManager.BindCombo(ddlDrugType, DTItemlist.Tables[1], "DrugTypeName", "drugTypeID");
            BindManager.BindCombo(ddlPurchaseUnit, theDS.Tables[3].Copy(), "Name", "Id");
            BindManager.BindCombo(ddlDispensingUnit, theDS.Tables[3].Copy(), "Name", "Id");
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
    }
Пример #4
0
        private void BindDrugTypeList()
        {
            IQCareUtils theUtils = new IQCareUtils();
            //chkSubItemTypeList.Items.Clear();
            IMasterList objDrugTypelist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
            int         ItemTypeid      = 0;

            if (ddlItemType.SelectedIndex > 0)
            {
                ItemTypeid = Convert.ToInt32(ddlItemType.SelectedValue.ToString());
            }
            DataSet theDS = objDrugTypelist.GetDrugType(ItemTypeid);

            theDrugTypeDT = theDS.Tables[0];
            theDrugType   = theDS.Tables[1];
            ////////DataView theDV = new DataView(theDT);
            ////////theDV.RowFilter = "DeleteFlag = 0";
            BindFunctions theBind = new BindFunctions();

            theBind.Win_BindCheckListBox(chkSubItemTypeList, theDrugType, "DrugTypeName", "DrugTypeID");
        }