예제 #1
0
        public static void SaveList(List <HCMIS.Desktop.DirectoryServices.Supplier> list)
        {
            BLL.Supplier bv = new BLL.Supplier();
            foreach (HCMIS.Desktop.DirectoryServices.Supplier 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.CompanyName != "" && v.CompanyName != null)
                {
                    bv.CompanyName = v.CompanyName;
                }
                if (v.Address != "" && v.Address != null)
                {
                    bv.Address = v.Address;
                }
                if (v.Telephone != "" && v.Telephone != null)
                {
                    bv.Telephone = v.Telephone;
                }
                if (v.ContactPerson != "" && v.ContactPerson != null)
                {
                    bv.ContactPerson = v.ContactPerson;
                }
                if (v.Mobile != "" && v.Mobile != null)
                {
                    bv.Mobile = v.Mobile;
                }
                if (v.CompanyInfo != "" && v.CompanyInfo != null)
                {
                    bv.CompanyInfo = v.CompanyInfo;
                }
                if (v.IsActive.HasValue)
                {
                    bv.IsActive = v.IsActive.Value;
                }
                if (v.Email != "" && v.Email != null)
                {
                    bv.Email = v.Email;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
 private void CostAnalysis_Load(object sender, EventArgs e)
 {
     gridJournal.DataSource = dvJournal;
     var store = new BLL.Activity();
     store.LoadByPrimaryKey(storeID);
     textEdit1.EditValue = store.Name;
     var supplier = new BLL.Supplier();
     supplier.LoadByPrimaryKey(supplierID);
     textEdit2.EditValue = supplier.CompanyName;
 }
예제 #3
0
        public bool PORefNo_Filter(object obj)
        {
            try
            {
                BLL.PurchaseReturn PO = obj as BLL.PurchaseReturn;
                BLL.Supplier       S  = cmbSupplier.SelectedItem as BLL.Supplier;

                return(PO.SupplierId == S.Id);
            }
            catch (Exception ex) { }
            return(false);
        }
예제 #4
0
        private void CostAnalysis_Load(object sender, EventArgs e)
        {
            gridJournal.DataSource = dvJournal;
            var store = new BLL.Activity();

            store.LoadByPrimaryKey(storeID);
            textEdit1.EditValue = store.Name;
            var supplier = new BLL.Supplier();

            supplier.LoadByPrimaryKey(supplierID);
            textEdit2.EditValue = supplier.CompanyName;
        }
예제 #5
0
        public static List <Supplier> ToList(BLL.Supplier v)
        {
            List <Supplier> list = new List <Supplier>();

            while (!v.EOF)
            {
                Supplier t = new Supplier();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("CompanyName"))
                {
                    t.CompanyName = v.CompanyName;
                }
                if (!v.IsColumnNull("Address"))
                {
                    t.Address = v.Address;
                }
                if (!v.IsColumnNull("Telephone"))
                {
                    t.Telephone = v.Telephone;
                }
                if (!v.IsColumnNull("ContactPerson"))
                {
                    t.ContactPerson = v.ContactPerson;
                }
                if (!v.IsColumnNull("Mobile"))
                {
                    t.Mobile = v.Mobile;
                }
                if (!v.IsColumnNull("CompanyInfo"))
                {
                    t.CompanyInfo = v.CompanyInfo;
                }
                if (!v.IsColumnNull("IsActive"))
                {
                    t.IsActive = v.IsActive;
                }
                if (!v.IsColumnNull("Email"))
                {
                    t.Email = v.Email;
                }
                //if(!v.IsColumnNull("IsDeleted"))
                //      t.IsDeleted = v.IsDeleted;
                //if(!v.IsColumnNull("UpdateTime"))
                //      t.UpdateTime = v.UpdateTime;

                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
예제 #6
0
        public static List <int> GetDeletedIDsAfter(long LastVersion)
        {
            BLL.Supplier v = new BLL.Supplier();
            //v.LoadDeletedIDs(LastVersion);
            List <int> list = new List <int>();

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
예제 #7
0
        public JsonResult addupd(Model.SupplierInfo supplier)
        {
            string strResult = "FAIL";

            if (supplier.SupplierName != null)
            {
                MoyeBuy.Com.BLL.Supplier bsupplier = new BLL.Supplier();
                if (bsupplier.AddUpdateProductSupplier(supplier))
                {
                    strResult = "SUCCESS";
                }
            }
            return(Json(strResult));
        }
예제 #8
0
        public JsonResult Del(string SupplierID)
        {
            string strResult = "FAIL";

            if (SupplierID != "")
            {
                MoyeBuy.Com.BLL.Supplier bsupplier = new BLL.Supplier();
                if (bsupplier.DelProductSupplierByID(SupplierID))
                {
                    strResult = "SUCCESS";
                }
            }
            return(Json(strResult));
        }
예제 #9
0
 public static void DeleteList(List <int> list)
 {
     BLL.Supplier bv = new BLL.Supplier();
     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
     }
 }
예제 #10
0
 public static List <Supplier> GetUpdatesAfter(long?lastVersion, DateTime?lastUpdateTime)
 {
     BLL.Supplier v = new BLL.Supplier();
     if (lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32(lastVersion.Value));
     }
     else if (lastUpdateTime.HasValue)
     {
         // v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }
     else
     {
         v.LoadAll();
     }
     return(ToList(v));
 }
예제 #11
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DataSet ds = new BLL.Product().GetAllList();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                Model.Supplier mo_supp = new Model.Supplier();
                string         s_name  = ds.Tables[0].Rows[i]["Name"].ToString();
                if (s_name.Length > 1)
                {
                    s_name = s_name.Substring(0, 2);
                }
                mo_supp.Name    = s_name;
                mo_supp.Address = s_name;
                BLL.Supplier bl_supp = new BLL.Supplier();
                bl_supp.Add(mo_supp);
            }
        }
        public static void DeleteList(List<int> list)
        {
            BLL.Supplier bv = new BLL.Supplier();
            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 List<int> GetDeletedIDsAfter(long LastVersion)
 {
     BLL.Supplier v = new BLL.Supplier();
     //v.LoadDeletedIDs(LastVersion);
     List<int> list = new List<int>();
     while (!v.EOF)
     {
         list.Add((int)v.GetColumn("ID"));
         v.MoveNext();
     }
     return list;
 }
 public static List<Supplier> GetUpdatesAfter(long? lastVersion,DateTime? lastUpdateTime)
 {
     BLL.Supplier v = new BLL.Supplier();
     if(lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32( lastVersion.Value ) );
     }else if(lastUpdateTime.HasValue)
     {
        // v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }else
     {
         v.LoadAll();
     }
     return ToList(v);
 }
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.Supplier> list)
        {
            BLL.Supplier bv = new BLL.Supplier();
            foreach (HCMIS.Desktop.DirectoryServices.Supplier 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.CompanyName != "" && v.CompanyName != null )
                   bv.CompanyName = v.CompanyName;
              if( v.Address != "" && v.Address != null )
                   bv.Address = v.Address;
              if( v.Telephone != "" && v.Telephone != null )
                   bv.Telephone = v.Telephone;
              if( v.ContactPerson != "" && v.ContactPerson != null )
                   bv.ContactPerson = v.ContactPerson;
              if( v.Mobile != "" && v.Mobile != null )
                   bv.Mobile = v.Mobile;
              if( v.CompanyInfo != "" && v.CompanyInfo != null )
                   bv.CompanyInfo = v.CompanyInfo;
              if( v.IsActive.HasValue )
                   bv.IsActive = v.IsActive.Value;
              if( v.Email != "" && v.Email != null )
                   bv.Email = v.Email;
              //if( v.IsDeleted.HasValue )
              //     bv.IsDeleted = v.IsDeleted.Value;
              //if( v.UpdateTime.HasValue )
              //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
예제 #16
0
 public static List <Supplier> GetAll()
 {
     BLL.Supplier v = new BLL.Supplier();
     v.LoadAll();
     return(ToList(v));
 }
예제 #17
0
        private string GetSupplierComboBox()
        {
            DataTable dt = new BLL.Supplier().GetList("").Tables[0];

            return(DBUtility.JsonHelper.DataTable2Json_ValueText(dt, "ID", "FullName"));
        }
 public static List<Supplier> GetAll()
 {
     BLL.Supplier v = new BLL.Supplier();
     v.LoadAll();
     return ToList(v);
 }