Example #1
0
        public MasterCheckListInCollection GetMasterCheckListInColl(DateTime dtCreated)
        {
            MasterCheckListInCollection ins = null;
            string str = dtCreated.Year.ToString() + "-" + dtCreated.Month.ToString() + "-" + dtCreated.Day.ToString() + " 00:00:00";

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                string             str2       = "SELECT master_checklist.* FROM master_checklist, master_checklist_type WHERE master_checklist_type.internal_id = checklist_type AND dt_created >= CAST('" + str + "' AS DATETIME)";
                DataTable          table      = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    ins = new MasterCheckListInCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        MasterCheckList list = new MasterCheckList(row[this.DataStructrure.Tables.MasterCheckList.InternalID.ActualFieldName].ToString())
                        {
                            checklist_question = row[this.DataStructrure.Tables.MasterCheckList.ChecklistQuestion.ActualFieldName].ToString(),
                            checklist_type     = row[this.DataStructrure.Tables.MasterCheckList.CheckListType.ActualFieldName].ToString(),
                            checklist_active   = row[this.DataStructrure.Tables.MasterCheckList.CheckListActive.ActualFieldName].ToString(),
                            checklist_seq      = row[this.DataStructrure.Tables.MasterCheckList.CheckListSeq.ActualFieldName].ToString()
                        };
                        ins.Add(list);
                    }
                    return(ins);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.CurDBEngine.ErrorMessage;
                return(ins);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.ErrMsg;
            return(ins);
        }
Example #2
0
        public MasterCheckListInCollection GetMasterCheckListInColl()
        {
            MasterCheckListInCollection ins = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.MasterCheckList.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    ins = new MasterCheckListInCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        MasterCheckList list = new MasterCheckList(row[this.DataStructrure.Tables.MasterCheckList.InternalID.ActualFieldName].ToString())
                        {
                            checklist_question = row[this.DataStructrure.Tables.MasterCheckList.ChecklistQuestion.ActualFieldName].ToString(),
                            checklist_type     = row[this.DataStructrure.Tables.MasterCheckList.CheckListType.ActualFieldName].ToString(),
                            checklist_active   = row[this.DataStructrure.Tables.MasterCheckList.CheckListActive.ActualFieldName].ToString(),
                            checklist_seq      = row[this.DataStructrure.Tables.MasterCheckList.CheckListSeq.ActualFieldName].ToString()
                        };
                        ins.Add(list);
                    }
                    return(ins);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.CurDBEngine.ErrorMessage;
                return(ins);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.ErrMsg;
            return(ins);
        }
Example #3
0
    public string DownloadMasterCheckList(DateTime dtCreated)
    {
        UploadManager CurUploadManager = new UploadManager();
        MasterCheckListInCollection masterCheckListCollection = CurUploadManager.DownloadMasterCheckList(dtCreated);
        string json = JsonConvert.SerializeObject(masterCheckListCollection);

        return(json);
    }
Example #4
0
    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);
    }