void RunThread() { while (true) { try { string filePath = System.IO.Path.Combine(CommonData.c_DirSaveFile, "product.json"); c_lst = c_Product_Controller.Get_All(); string _json = CommonFunction.Create_List_Json_Send <Product_Info>("PRODUCT", c_lst); File.WriteAllText(filePath, _json); ShowText(DateTime.Now.ToString("HH:mm:ss") + " - Save file " + filePath); filePath = System.IO.Path.Combine(CommonData.c_DirSaveFile, "color.json"); c_lst_color = c_Color_Controller.Get_All(); _json = CommonFunction.Create_List_Json_Send <Color_Info>("COLOR", c_lst_color); File.WriteAllText(filePath, _json); ShowText(DateTime.Now.ToString("HH:mm:ss") + " - Save file " + filePath); Thread.Sleep(CommonData.c_TimeSleepSaveFile * 1000 * 60); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); txtJsonString.Text = ex.ToString(); Thread.Sleep(60000); } } }
void GetAllColor() { try { c_hs_color = new Hashtable(); Color_Controller _Color_Controller = new Color_Controller(); List <Color_Info> _lst = _Color_Controller.Get_All(); foreach (Color_Info item in _lst) { c_hs_color[item.Color_Id] = item; } cboColor.SelectedValuePath = "Color_Id"; cboColor.DisplayMemberPath = "ColorName"; cboColor.ItemsSource = _lst; cboColor.SelectedIndex = 0; } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
void LoadData() { try { c_lst = c_Color_Controller.Get_All(); dgrColor.ItemsSource = c_lst; DataGridHelper.NVSFocus(dgrColor, 0, 0); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
public static DataView Get_Color() { DataTable dt = new DataTable(); dt.Columns.Add("Color_Id"); dt.Columns.Add("ColorName"); Color_Controller _Color_Controller = new Color_Controller(); List <Color_Info> _lst = _Color_Controller.Get_All(); foreach (Color_Info item in _lst) { dt.Rows.Add(item.Color_Id.ToString(), item.ColorName); } return(dt.DefaultView); }
void GetAllColor() { try { c_hs_color = new Hashtable(); Color_Controller _Color_Controller = new Color_Controller(); List <Color_Info> _lst = _Color_Controller.Get_All(); foreach (Color_Info item in _lst) { c_hs_color[item.Color_Id] = item; } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }