コード例 #1
0
        /// <summary>
        /// Finds and returns an item with the specified name.
        /// </summary>
        /// <param name="itemName">The name of the item to find.</param>
        /// <param name="result">The resulting item.</param>
        /// <returns><c>true</c> if the item was found; otherwise, <c>false</c>.</returns>
        public bool TryGetItem(string itemName, out INItem result)
        {
            if (!_items.TryGetValue(itemName, out var item))
            {
                result = null;
                return(false);
            }

            result = item;
            return(true);
        }
コード例 #2
0
        private void Fill_Grid_2()
        {
            database1 clsdatabase1 = new database1();
            INItem    clsINItem    = new INItem();
            DataSet   ds           = new DataSet();

            ds = clsINItem.Fill_Grid(mSys_System.pComp_ID, mSys_System.pUser_ID, "");
            if (clsINItem.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsdatabase1.sErrorCode, false);
                return;
            }
            DataTable dt = ds.Tables[0];

            gridControl_Item.DataSource = dt;
        }
コード例 #3
0
        private void cmb2_Delete_Click(object sender, EventArgs e)
        {
            INItem clsINItem = new INItem();
            int    Ret_Value = 0;

            if (lblItem_ID.Text.Trim() == "")
            {
                clsHomeScreen.Display_Message("Please select a record first to delete....................", false);
                return;
            }
            //if (MessageBox.Show(Msg_BeforeDelete_1, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            //{
            //    return;
            //}

            //if (MessageBox.Show(Msg_BeforeDelete_2, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            //{
            //    return;
            //}
            //strAuth_D = mSys_IN.pcU_M_01_C01_D;

            Ret_Value = clsINItem.Save_Delete(lblItem_ID.Text,
                                              mSys_System.pComp_ID, mSys_System.pUserName, mSys_System.pUser_ID, strAuth_D);
            if (clsINItem.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsINItem.sErrorCode + "......", false);
                return;
            }
            if (Ret_Value == -1)
            {
                clsHomeScreen.Display_Message(clsINItem.strErr_Msg + "....................", false);
                return;
            }
            if (Ret_Value == 0)
            {
                clsHomeScreen.Display_Message("ERROR SAVEING/UPDATIN RECORDS....................", false);
                return;
            }
            if (Ret_Value == 1)
            {
                clsHomeScreen.Display_Message("RECORDS SAVED SUCCESSFULLY....................", false);
                Set_Refresh_2();
                Fill_Grid_2();
                return;
            }
        }
コード例 #4
0
        private void Find_Record_2(int ID)
        {
            database1 clsdatabase1 = new database1();
            INItem    clsINItem    = new INItem();
            DataSet   ds           = new DataSet();

            ds = clsINItem.Find_Record(mSys_System.pComp_ID, ID);
            if (clsINItem.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsdatabase1.sErrorCode, false);
                return;
            }

            DataTable dt = ds.Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                lblItem_ID.Text      = dt.Rows[i]["Item_ID"].ToString();
                txtItem_D.Text       = dt.Rows[i]["Item_D"].ToString();
                txtItem_DD.Text      = dt.Rows[i]["Item_DD"].ToString();
                txtItem_Rate.Text    = dt.Rows[i]["Item_Rate"].ToString();
                txtItem_SrNo.Text    = dt.Rows[i]["Item_SrNo"].ToString();
                txtMax_Level.Text    = dt.Rows[i]["Max_Level"].ToString();
                txtMin_Level.Text    = dt.Rows[i]["Min_Level"].ToString();
                txtA_UnitFactor.Text = dt.Rows[i]["A_UnitFactor"].ToString();
                txtItem_BarCode.Text = dt.Rows[i]["Item_BarCode"].ToString();

                lookUnit_ID.EditValue   = (dt.Rows[i]["Unit_ID"] == null || dt.Rows[i]["Unit_ID"].ToString() == "") ? null : dt.Rows[i]["Unit_ID"];
                lookA_Unit_ID.EditValue = (dt.Rows[i]["A_Unit_ID"] == null || dt.Rows[i]["A_Unit_ID"].ToString() == "") ? null : dt.Rows[i]["A_Unit_ID"];
                lookCat_ID.EditValue    = (dt.Rows[i]["Cat_ID"] == null || dt.Rows[i]["Cat_ID"].ToString() == "") ? null : dt.Rows[i]["Cat_ID"];
                lookSCat_ID.EditValue   = (dt.Rows[i]["SCat_ID"] == null || dt.Rows[i]["SCat_ID"].ToString() == "") ? null : dt.Rows[i]["SCat_ID"];
                lookIType_ID.EditValue  = (dt.Rows[i]["IType_ID"] == null || dt.Rows[i]["IType_ID"].ToString() == "") ? null : dt.Rows[i]["IType_ID"];
                lookSize_ID.EditValue   = (dt.Rows[i]["Size_ID"] == null || dt.Rows[i]["Size_ID"].ToString() == "") ? null : dt.Rows[i]["Size_ID"];

                chkItem_Active.Checked = Convert.ToBoolean(dt.Rows[i]["Item_Active"]);
                chkIsA_Unit.Checked    = Convert.ToBoolean(dt.Rows[i]["IsA_Unit"]);
                chkItem_A1.Checked     = Convert.ToBoolean(dt.Rows[i]["Item_A1"]);
                chkItem_A2.Checked     = Convert.ToBoolean(dt.Rows[i]["Item_A2"]);
                chkItem_A3.Checked     = Convert.ToBoolean(dt.Rows[i]["Item_A3"]);
                chkItem_A4.Checked     = Convert.ToBoolean(dt.Rows[i]["Item_A4"]);
                chkItem_A5.Checked     = Convert.ToBoolean(dt.Rows[i]["Item_A5"]);
            }
        }
コード例 #5
0
        private void Fill_Combo()
        {
            database1 clsdatabase1 = new database1();
            INItem    clsINItem    = new INItem();
            DataSet   ds           = new DataSet();

            ds = clsINItem.Fill_Combo(mSys_System.pComp_ID, mSys_System.pUser_ID);
            if (clsINItem.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsdatabase1.sErrorCode, false);
                return;
            }

            Fill_Cat();
            Fill_SCat();
            Set_Combo(lookIType_ID, ds.Tables[0], "IType_DD", "IType_ID", true);
            Set_Combo(lookSize_ID, ds.Tables[1], "Size_DD", "Size_ID", true);
            Set_Combo(lookUnit_ID, ds.Tables[2], "Unit_DD", "Unit_ID", true);
            Set_Combo(lookA_Unit_ID, ds.Tables[2], "Unit_DD", "Unit_ID", true);
        }
コード例 #6
0
        /// <summary>
        /// Adds the specified item to the <see cref="NItemCollection"/>.
        /// </summary>
        /// <param name="item">The item to add.</param>
        public void Add(INItem item)
        {
            if (Contains(item))
            {
                return;
            }

            if (!(item is NItem i))
            {
                return;
            }

            i.Depth = Owner.Depth + 1;
            i.Index = Count;

            _items.Add(item.Name, item);
            OnItemAdded(new ItemAddedEventArgs(this, item));

            switch (item)
            {
            case INProperty property:
            {
                _propertyNames.Add(property.Name);
                OnPropertyAdded(new PropertyAddedEventArgs(this, property));

                break;
            }

            case INCompound compound:
            {
                _compoundNames.Add(item.Name);
                OnCompoundAdded(new CompoundAddedEventArgs(this, compound));

                break;
            }
            }
        }
コード例 #7
0
 public ItemAddedEventArgs([NotNull] INItemCollection collection, [NotNull] INItem item) : base(collection)
 {
     Item = item;
 }
コード例 #8
0
 public StoneBlockHandler(INItem Class) : base(Class)
 {
 }
コード例 #9
0
 public ItemHandler(INItem Class)
 {
     this.Class = Class;
 }
コード例 #10
0
 public GrassBlockHandler(INItem Class) : base(Class)
 {
 }
コード例 #11
0
 /// <summary>
 /// Returns a value indicating whether the <see cref="NItemCollection"/> contains the specified item.
 /// </summary>
 /// <param name="item">The item to find.</param>
 /// <returns><c>true</c> if the item was found; otherwise, <c>false</c>.</returns>
 public bool Contains(INItem item)
 {
     return(Contains(item.Name));
 }
コード例 #12
0
 /// <summary>
 /// Removes the specified item from the <see cref="INItemCollection"/>.
 /// </summary>
 /// <param name="item">The item to remove.</param>
 /// <returns><c>true</c> if the item was removed; otherwise, <c>false</c>.</returns>
 public bool Remove(INItem item)
 {
     return(Remove(item.Name));
 }
コード例 #13
0
 public AirBlockHandler(INItem Class) : base(Class)
 {
 }
コード例 #14
0
        private bool Save_Update_2(int IsUpdate)

        {
            INItem clsINItem = new INItem();
            int    Ret_Value = 0;

            if (IsUpdate == 0)
            {
                //---alert
                //strAuth_D = mSys_IN.pcU_M_01_C01_S;

                //if (MessageBox.Show(Msg_BeforeSave, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                //{
                //    return false;
                //}
            }
            else if (IsUpdate == 1) //---update
            {
                //strAuth_D = mSys_IN.pcU_M_01_C01_U;

                ////---alert
                //if (MessageBox.Show(Msg_BeforeUpdate, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                //{
                //    return false;
                //}
            }
            int    vCat_ID       = 0;
            int    vSCat_ID      = 0;
            int    vIType_ID     = 0;
            int    vSize_ID      = 0;
            int    vUnit_ID      = 0;
            int    vA_Unit_ID    = 0;
            double vA_UnitFactor = 0;
            double vMin_Level    = 0;
            double vMax_Level    = 0;


            if (lookCat_ID.EditValue != null && lookCat_ID.EditValue.ToString() != "")
            {
                vCat_ID = Convert.ToInt32(lookCat_ID.EditValue);
            }
            if (lookSCat_ID.EditValue != null && lookSCat_ID.EditValue.ToString() != "")
            {
                vSCat_ID = Convert.ToInt32(lookSCat_ID.EditValue);
            }
            if (lookIType_ID.EditValue != null && lookIType_ID.EditValue.ToString() != "")
            {
                vIType_ID = Convert.ToInt32(lookIType_ID.EditValue);
            }
            if (lookSize_ID.EditValue != null && lookSize_ID.EditValue.ToString() != "")
            {
                vSize_ID = Convert.ToInt32(lookSize_ID.EditValue);
            }
            if (lookUnit_ID.EditValue != null && lookUnit_ID.EditValue.ToString() != "")
            {
                vUnit_ID = Convert.ToInt32(lookUnit_ID.EditValue);
            }
            if (lookA_Unit_ID.EditValue != null && lookA_Unit_ID.EditValue.ToString() != "")
            {
                vA_Unit_ID = Convert.ToInt32(lookA_Unit_ID.EditValue);
            }
            if (txtA_UnitFactor.Text.Trim() != "")
            {
                vA_UnitFactor = Convert.ToDouble(txtA_UnitFactor.Text.Trim());
            }
            if (txtMin_Level.Text.Trim() != "")
            {
                vMin_Level = Convert.ToDouble(txtMin_Level.Text.Trim());
            }
            if (txtMax_Level.Text.Trim() != "")
            {
                vMax_Level = Convert.ToDouble(txtMax_Level.Text.Trim());
            }

            Ret_Value = clsINItem.Save_Master(lblItem_ID.Text, txtItem_D.Text.Trim(), txtItem_DD.Text.Trim(),
                                              vCat_ID, vSCat_ID, vIType_ID, vSize_ID, vUnit_ID, vA_Unit_ID, txtItem_BarCode.Text.Trim(), txtItem_SrNo.Text.Trim(),
                                              vMin_Level, vMax_Level, vA_UnitFactor, chkItem_Active.Checked,
                                              chkItem_A1.Checked, chkItem_A2.Checked, chkItem_A3.Checked, chkItem_A4.Checked, chkItem_A5.Checked,
                                              chkIsA_Unit.Checked, mSys_System.pComp_ID, mSys_System.pBranch_ID, mSys_System.pUser_Dept_ID, mSys_System.pUserName, mSys_System.pUser_ID,
                                              IsUpdate, strAuth_D);
            if (clsINItem.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsINItem.sErrorCode + "......", false);
                return(false);
            }
            if (Ret_Value == -1)
            {
                clsHomeScreen.Display_Message(clsINItem.strErr_Msg + "....................", false);
                return(true);
            }
            if (Ret_Value == 0)
            {
                clsHomeScreen.Display_Message("ERROR SAVING/UPDATING RECORDS....................", false);
                return(true);
            }
            if (Ret_Value == 1)
            {
                txtItem_D.Text  = clsINItem.str_Code;
                lblItem_ID.Text = clsINItem.str_ID.ToString();
                Set_Refresh_2();
                clsHomeScreen.Display_Message("RECORDS SAVED SUCCESSFULLY....................", true);
                return(true);
            }

            return(true);
        }
コード例 #15
0
 public DirtBlockHandler(INItem Class) : base(Class)
 {
 }