//#region Web Service Getters

        //    public static List<CommodityType> GetAll()
        //    {
        //        BLL.CommodityType v = new BLL.CommodityType();
        //        v.LoadAll();
        //        return ToList(v);
        //    }

        //    public static List<CommodityType> GetUpdatesAfter(long? lastVersion,DateTime? lastUpdateTime)
        //    {
        //        BLL.CommodityType v = new BLL.CommodityType();
        //        if(lastVersion.HasValue && lastVersion.Value != 0)
        //        {
        //            v.LoadUpdatesAfter( lastVersion.Value );
        //        }else if(lastUpdateTime.HasValue)
        //        {
        //            v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
        //        }else
        //        {
        //            v.LoadAll();
        //        }
        //        return ToList(v);
        //    }

        //    public static List<int> GetDeletedIDsAfter(long LastVersion)
        //    {
        //         BLL.CommodityType v = new BLL.CommodityType();
        //        v.LoadDeletedIDs(LastVersion);
        //        List<int> list = new List<int>();
        //        while (!v.EOF)
        //        {
        //            list.Add((int)v.GetColumn("ID"));
        //            v.MoveNext();
        //        }
        //        return list;
        //    }

        //#endregion



        #region Utilities


        #endregion


        #region Web service Saving

        public static void SaveList(List <HCMIS.Desktop.DirectoryServices.CommodityType> list)
        {
            BLL.Type bv = new BLL.Type();
            foreach (HCMIS.Desktop.DirectoryServices.CommodityType v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
                if (v.ID.HasValue)
                {
                    bv.ID = v.ID.Value;
                }
                if (v.Name != "" && v.Name != null)
                {
                    bv.Name = v.Name;
                }
                if (v.Description != "" && v.Description != null)
                {
                    bv.Description = v.Description;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
示例#2
0
        private void InsertData()
        {
            Objects.Type Obj = new Objects.Type();
            Obj.TypeID   = new BLL.Type().GetMaxID();
            Obj.TypeName = txtType.Text;
            int vCheck = new BLL.Type().InsertData(Obj);

            if (vCheck == 1)
            {
                MessageBox.Show("Data Inserted");
            }
        }
 public static void DeleteList(List <int> list)
 {
     BLL.Type bv = new BLL.Type();
     foreach (int v in list)
     {
         // try to load by primary key
         bv.LoadByPrimaryKey(v);
         // if the entry doesn't exist, create it
         if (bv.RowCount > 0)
         {
             bv.MarkAsDeleted();
             bv.Save();
         }
         // populate the contents of v on the to the database list
     }
 }
示例#4
0
 private void categoryName_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
 {
     BLL.Type catType = new BLL.Type();
     catType.LoadByPrimaryKey(Convert.ToInt16(xrTypeID.Text));
     categoryName.Text = catType.Name;
 }
        public static void DeleteList(List<int> list)
        {
            BLL.Type bv = new BLL.Type();
            foreach (int v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v);
                // if the entry doesn't exist, create it
                if (bv.RowCount > 0)
                {
                    bv.MarkAsDeleted();
                    bv.Save();
                }
                // populate the contents of v on the to the database list

            }
        }
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.CommodityType> list)
        {
            BLL.Type bv = new BLL.Type();
            foreach (HCMIS.Desktop.DirectoryServices.CommodityType v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
              if( v.ID.HasValue )
                   bv.ID = v.ID.Value;
              if( v.Name != "" && v.Name != null )
                   bv.Name = v.Name;
              if( v.Description != "" && v.Description != null )
                   bv.Description = v.Description;
              //if( v.IsDeleted.HasValue )
              //     bv.IsDeleted = v.IsDeleted.Value;
              //if( v.UpdateTime.HasValue )
              //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }