public PrinterInformation(StoreInformation store) { this.StoreNo = store.StoreNo; this.StoreRegion = store.StoreRegion; this.StoreType = store.StoreType; this.PrinterType = store.StoreType; this.TonerType = store.TonerType; }
public PrinterInformation(StoreInformation store) { this.StoreNo = store.StoreNo; this.StoreRegion = store.StoreRegion; this.StoreType = store.StoreType; this.PrinterType = store.StoreType; this.TonerType = store.TonerType; }
public static void InsertStoreInformationTemp() { DataSet ds = SqlHelper.GetOpeningStores(); List <StoreInformation> list = new List <StoreInformation>(); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { string storeNo = ds.Tables[0].Rows[i][0].ToString(); StoreHost host = Common.GetStoreHost(storeNo); StoreInformation store = new StoreInformation(host); store.StoreNo = storeNo; store.StoreRegion = ds.Tables[0].Rows[i][1].ToString(); store.StoreType = ds.Tables[0].Rows[i][2].ToString(); list.Add(store); } string[] clist = { "storeNo", "storeRegion", "storeType", "printerIP", "routerIP", "laptopIP1", "laptopIP2", "fingerIP", "flowIP", "emailAddress", "printerType", "tonerType", "routerType" }; DataTable dt = new DataTable(); foreach (string colname in clist) { dt.Columns.Add(colname); } int rowcount = list.Count; for (int i = 0; i < rowcount; i++) { DataRow row = dt.NewRow(); row["storeNo"] = list[i].StoreNo; row["storeRegion"] = list[i].StoreRegion; row["storeType"] = list[i].StoreType; row["printerIP"] = list[i].PrinterIP; row["routerIP"] = list[i].RouterIP; row["laptopIP1"] = list[i].LaptopIP1; row["laptopIP2"] = list[i].LaptopIP2; row["fingerIP"] = list[i].FingerIP; row["flowIP"] = list[i].FlowIP; row["emailAddress"] = list[i].StoreNo + "*****@*****.**"; // [email protected] row["printerType"] = null; row["tonerType"] = null; row["routerType"] = null; dt.Rows.Add(row); } SqlHelper.TruncateStoreInformationTemp(); SqlHelper.CommonBulkInsert(dt, "StoreInformationTemp"); }
public static void UpdateStoreInformation(StoreInformation store) { SqlParameter[] paras = { new SqlParameter("@storeNo", store.StoreNo), new SqlParameter("@printerIP", store.PrinterIP), new SqlParameter("@routerIP", store.RouterIP), new SqlParameter("@laptopIP1", store.LaptopIP1), new SqlParameter("@laptopIP2", store.LaptopIP2), new SqlParameter("@fingerIP", store.FingerIP), new SqlParameter("@flowIP", store.FlowIP), new SqlParameter("@emailAddress", store.EmailAddress), new SqlParameter("@printerType", store.PrinterType), new SqlParameter("@tonerType", store.TonerType), new SqlParameter("@routerType", store.RouterType) }; SqlHelper.ExecuteNonQuery("UpdateStoreInformation", paras); }
public static void UpdateStoreInformation(StoreInformation store) { SqlParameter[] paras = { new SqlParameter("@storeNo",store.StoreNo), new SqlParameter("@printerIP",store.PrinterIP), new SqlParameter("@routerIP",store.RouterIP), new SqlParameter("@laptopIP1",store.LaptopIP1), new SqlParameter("@laptopIP2",store.LaptopIP2), new SqlParameter("@fingerIP",store.FingerIP), new SqlParameter("@flowIP",store.FlowIP), new SqlParameter("@emailAddress",store.EmailAddress), new SqlParameter("@printerType",store.PrinterType), new SqlParameter("@tonerType",store.TonerType), new SqlParameter("@routerType",store.RouterType) }; SqlHelper.ExecuteNonQuery("UpdateStoreInformation", paras); }
public static void InsertStoreInformationTemp() { DataSet ds = SqlHelper.GetOpeningStores(); List<StoreInformation> list = new List<StoreInformation>(); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++ ) { string storeNo = ds.Tables[0].Rows[i][0].ToString(); StoreHost host = Common.GetStoreHost(storeNo); StoreInformation store = new StoreInformation(host); store.StoreNo = storeNo; store.StoreRegion = ds.Tables[0].Rows[i][1].ToString(); store.StoreType = ds.Tables[0].Rows[i][2].ToString(); list.Add(store); } string[] clist = { "storeNo", "storeRegion", "storeType", "printerIP", "routerIP", "laptopIP1", "laptopIP2", "fingerIP", "flowIP", "emailAddress", "printerType", "tonerType", "routerType" }; DataTable dt = new DataTable(); foreach (string colname in clist) { dt.Columns.Add(colname); } int rowcount = list.Count; for (int i = 0; i < rowcount; i++ ) { DataRow row = dt.NewRow(); row["storeNo"] = list[i].StoreNo; row["storeRegion"] = list[i].StoreRegion; row["storeType"] = list[i].StoreType; row["printerIP"] = list[i].PrinterIP; row["routerIP"] = list[i].RouterIP; row["laptopIP1"] = list[i].LaptopIP1; row["laptopIP2"] = list[i].LaptopIP2; row["fingerIP"] = list[i].FingerIP; row["flowIP"] = list[i].FlowIP; row["emailAddress"] = list[i].StoreNo + "*****@*****.**"; // [email protected] row["printerType"] = null; row["tonerType"] = null; row["routerType"] = null; dt.Rows.Add(row); } SqlHelper.TruncateStoreInformationTemp(); SqlHelper.CommonBulkInsert(dt, "StoreInformationTemp"); }