コード例 #1
0
 public static CommonObjects[] GetCity(string ProvinceId)
 {
     Vendors objVendors=new Vendors();
     DataTable dtCity = objVendors.GetCityForProvince(ProvinceId);
     DataRow newRowCity = dtCity.NewRow();
     newRowCity["alias"] = "-1";
     newRowCity["nama_kota"] = "-City-";
     dtCity.Rows.InsertAt(newRowCity, 0);
     dtCity.AcceptChanges();
     CommonObjects[] objCity = new CommonObjects[dtCity.Rows.Count];
     int intCount = 0;
     foreach (DataRow drw in dtCity.Rows)
     {
         objCity[intCount] = new CommonObjects();
         objCity[intCount].Value = drw["alias"].ToString();
         objCity[intCount].Text = drw["nama_kota"].ToString();
         objCity[intCount].DefaultValue = objCity[0].Value;
         intCount++;
     }
     return objCity;
 }
コード例 #2
0
 public static CommonObjects[] GetDropProvince()
 {
     DataTable dtProvince = GetProvinceDatatable();
     CommonObjects[] objProvince = new CommonObjects[dtProvince.Rows.Count + 1];
     DataRow newRowProvince = dtProvince.NewRow();
     newRowProvince["ID"] = "-1";
     newRowProvince["Alias"] = "-1";
     newRowProvince["nama_daerah"] = "-Province-";
     dtProvince.Rows.InsertAt(newRowProvince, 0);
     dtProvince.AcceptChanges();
     objProvince = new CommonObjects[dtProvince.Rows.Count];
     int intCount = 0;
     foreach (DataRow drw in dtProvince.Rows)
     {
         objProvince[intCount] = new CommonObjects();
         objProvince[intCount].Value = drw["Alias"].ToString();
         objProvince[intCount].Text = drw["nama_daerah"].ToString();
         objProvince[intCount].DefaultValue = objProvince[0].Value;
         intCount++;
     }
     return objProvince;
 }
コード例 #3
0
        public CommonObjects[] GetVendorsList()
        {
            DataTable dtVendors = SQL.BLL.GetVendorsList(1000, PageSize, "", "id", 1);

            DataRow newRowVendor = dtVendors.NewRow();
            newRowVendor["alias_vendors"] = "-1";
            newRowVendor["nama_vendors"] = "-Select Vendor-";
            dtVendors.Rows.InsertAt(newRowVendor, 0);
            dtVendors.AcceptChanges();
            CommonObjects[] objVendor = new CommonObjects[dtVendors.Rows.Count];
            int intCount = 0;
            foreach (DataRow drw in dtVendors.Rows)
            {
                objVendor[intCount] = new CommonObjects();
                objVendor[intCount].Value = drw["alias_vendors"].ToString();
                objVendor[intCount].Text = drw["nama_vendors"].ToString();
                objVendor[intCount].DefaultValue = objVendor[0].Value;
                intCount++;
            }
            return objVendor;
        }
コード例 #4
0
        public CommonObjects[] GetItemCategoryList()
        {
            DataTable dtItemCategory = SQL.BLL.GetCategoryList(1, 1000, "", "id", 1);

            DataRow newRowItemCategory = dtItemCategory.NewRow();
            newRowItemCategory["Alias"] = "-1";
            newRowItemCategory["Category"] = "-Category-";
            dtItemCategory.Rows.InsertAt(newRowItemCategory, 0);
            dtItemCategory.AcceptChanges();
            CommonObjects[] objVendor = new CommonObjects[dtItemCategory.Rows.Count];
            int intCount = 0;
            foreach (DataRow drw in dtItemCategory.Rows)
            {
                objVendor[intCount] = new CommonObjects();
                objVendor[intCount].Value = drw["Alias"].ToString();
                objVendor[intCount].Text = drw["Category"].ToString();
                objVendor[intCount].DefaultValue = objVendor[0].Value;
                intCount++;
            }
            return objVendor;
        }