public MasterCheckListRelationCollection GetMasterCheckListRelationInColl() { MasterCheckListRelationCollection relations = null; if (this.TryConnection()) { DatabaseParameters parameters = new DatabaseParameters(); base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.MasterCheckListRelation.ActualTableName); DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL); if (table != null) { relations = new MasterCheckListRelationCollection(); foreach (DataRow row in table.Rows) { MasterCheckListRelation relation = new MasterCheckListRelation { checklist_type = row[this.DataStructrure.Tables.MasterCheckListRelation.ChecklistType.ActualFieldName].ToString(), dchannel = row[this.DataStructrure.Tables.MasterCheckListRelation.DistChannel.ActualFieldName].ToString(), plant = row[this.DataStructrure.Tables.MasterCheckListRelation.PlantNo.ActualFieldName].ToString() }; relations.Add(relation); } return(relations); } base.error_occured = true; base.ErrMsg = "[MasterCheckListManager] : GetMasterCheckListRelationInColl : " + base.CurDBEngine.ErrorMessage; return(relations); } base.error_occured = true; base.ErrMsg = "[MasterCheckListManager] : GetMasterCheckListRelationInColl : " + base.ErrMsg; return(relations); }
public string DownloadMasterCheckListRelation() { UploadManager CurUploadManager = new UploadManager(); MasterCheckListRelationCollection checkListRelationCollection = CurUploadManager.DownloadMasterCheckListRelation(); string json = JsonConvert.SerializeObject(checkListRelationCollection); return(json); }
public string DownloadMasterDataFromSQL(DateTime dtCreated, string employeeID) { string json = ""; this.GeneralLogManager = new LogManager(tmp_config); try { UploadManager CurUploadManager = new UploadManager(); MasterCauseCollection CausesCollection = CurUploadManager.DownloadMasterCauses(dtCreated); if (CausesCollection != null) { json += "MasterCauses " + JsonConvert.SerializeObject(CausesCollection); } MasterDamageCollection DamagesCollection = CurUploadManager.DownloadMasterDamages(dtCreated); if (DamagesCollection != null) { json += "MasterDamages" + JsonConvert.SerializeObject(DamagesCollection); } MasterCustomerCollection customerCollection = CurUploadManager.DownloadMasterCustomers(dtCreated); if (customerCollection != null) { json += "MasterCustomers" + JsonConvert.SerializeObject(customerCollection); } MasterEquipmentCollection equipmentCollection = CurUploadManager.DownloadMasterEquipment(dtCreated); if (equipmentCollection != null) { json += "MasterEquipment" + JsonConvert.SerializeObject(equipmentCollection); } MasterLookUpCollection lookUpCollection = CurUploadManager.DownloadMasterLookUp(dtCreated); if (lookUpCollection != null) { json += "MasterLookUp" + JsonConvert.SerializeObject(lookUpCollection); } ApplicationUserCollection UserCollection = CurUploadManager.DownloadMasterUsersInColl(dtCreated); if (UserCollection != null) { json += "MasterUsers" + JsonConvert.SerializeObject(UserCollection); } MasterQuickNotesCollection quickNotesCollection = CurUploadManager.DownloadQuickNotes(); if (quickNotesCollection != null) { json += "MasterQuickNotes" + JsonConvert.SerializeObject(quickNotesCollection); } MasterCheckListTypeCollection masterCheckListTypeColleaction = CurUploadManager.DownloadMasterCheckListType(); if (masterCheckListTypeColleaction != null) { json += "MasterCheckListType" + JsonConvert.SerializeObject(masterCheckListTypeColleaction); } MasterCheckListInCollection masterCheckListCollection = CurUploadManager.DownloadMasterCheckList(); if (masterCheckListCollection != null) { json += "MasterCheckList" + JsonConvert.SerializeObject(masterCheckListCollection); } MasterCheckListRelationCollection checkListRelationCollection = CurUploadManager.DownloadMasterCheckListRelation(); if (checkListRelationCollection != null) { json += "MasterCheckListRelation" + JsonConvert.SerializeObject(checkListRelationCollection); } if (json.Equals("")) { this.GeneralLogManager.LogAction("DownloadMasterDataFromSQL", employeeID, "Result :: null "); } else { this.GeneralLogManager.LogAction("DownloadMasterDataFromSQL", employeeID, "Result :: " + json); } } catch (Exception e) { string ErrorID = SwissArmy.UniqueID(); this.CurLogManager.LogError(ErrorID, "DownloadMasterDataFromSQL: Error :: " + e.ToString(), employeeID); json = "Error: " + e.ToString(); } return(json); }