public bool DeleteOpCheckListHeader()
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                base.CurSQLFactory.DeleteCommand(keys, this.DataStructrure.Tables.OpCheckListHeader.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpCheckListHeaderManager] : DeleteOpCheckListHeader : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpCheckListHeaderManager] : DeleteOpCheckListHeader : " + base.ErrMsg;
            return(flag);
        }
Exemple #2
0
        public ApplicationUserCollection GetMasterUsers(string dchannel, string plant)
        {
            ApplicationUserCollection users = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                if (dchannel.Length > 0)
                {
                    parameters.Add(new DatabaseParameter(this.CurDataStructure.Tables.MasterUsers.DistributionChannel.ActualFieldName, dchannel));
                }
                if (plant.Length > 0)
                {
                    parameters.Add(new DatabaseParameter(this.CurDataStructure.Tables.MasterUsers.Plant.ActualFieldName, plant));
                }
                base.CurSQLFactory.SelectCommand(parameters, this.CurDataStructure.Tables.MasterUsers.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    users = new ApplicationUserCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        ApplicationUser user = new ApplicationUser(row[this.CurDataStructure.Tables.MasterUsers.InternalID.ActualFieldName].ToString())
                        {
                            FirstName = row[this.CurDataStructure.Tables.MasterUsers.FirstName.ActualFieldName].ToString(),
                            UserID    = row[this.CurDataStructure.Tables.MasterUsers.UserID.ActualFieldName].ToString(),
                            LastName  = row[this.CurDataStructure.Tables.MasterUsers.LastName.ActualFieldName].ToString(),
                            Password  = row[this.CurDataStructure.Tables.MasterUsers.Password.ActualFieldName].ToString()
                        };
                        users.Add(user);
                    }
                    return(users);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterUsers] : GetMasterUsers : " + base.CurDBEngine.ErrorMessage;
                return(users);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterUsers] : GetMasterUsers : " + base.ErrMsg;
            return(users);
        }
Exemple #3
0
        public ApplicationUserCollection GetMasterUsersInColl(DateTime dtCreated)
        {
            ApplicationUserCollection users = null;
            string str = dtCreated.Year.ToString() + "-" + dtCreated.Month.ToString() + "-" + dtCreated.Day.ToString() + " 00:00:00";

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                base.CurSQLFactory.SelectCommand(parameters, this.CurDataStructure.Tables.MasterUsers.ActualTableName);
                base.CurSQLFactory.SQL = base.CurSQLFactory.SQL + " WHERE dt_created >= CAST('" + str + "' AS DATETIME)";
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    users = new ApplicationUserCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        ApplicationUser user = new ApplicationUser(row[this.CurDataStructure.Tables.MasterUsers.InternalID.ActualFieldName].ToString())
                        {
                            FirstName           = row[this.CurDataStructure.Tables.MasterUsers.FirstName.ActualFieldName].ToString(),
                            UserID              = row[this.CurDataStructure.Tables.MasterUsers.UserID.ActualFieldName].ToString(),
                            LastName            = row[this.CurDataStructure.Tables.MasterUsers.LastName.ActualFieldName].ToString(),
                            Password            = row[this.CurDataStructure.Tables.MasterUsers.Password.ActualFieldName].ToString(),
                            DistributionChannel = row[this.CurDataStructure.Tables.MasterUsers.DistributionChannel.ActualFieldName].ToString(),
                            VehicleNumber       = row[this.CurDataStructure.Tables.MasterUsers.VehicleNumber.ActualFieldName].ToString(),
                            Plant = row[this.CurDataStructure.Tables.MasterUsers.Plant.ActualFieldName].ToString()
                        };
                        users.Add(user);
                    }
                    this.DisposeObjects();
                    return(users);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterUsers] : GetMasterUsers : " + base.CurDBEngine.ErrorMessage;
                this.DisposeObjects();
                return(users);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterUsers] : GetMasterUsers : " + base.ErrMsg;
            this.DisposeObjects();
            return(users);
        }
Exemple #4
0
        private void AddUpdateItem(Int32 itemNo, Dictionary <string, string> dic)
        {
            if (dic != null)
            {
                int      liNoP     = int.Parse(dic["NoP"]);
                DateTime StartDate = Convert.ToDateTime(dic["StartDate"], new CultureInfo("es-US"));

                if (DataValidation(StartDate, liNoP))
                {
                    ArrayList          sqlList       = new ArrayList();
                    DatabaseParameters KeyParameters = new DatabaseParameters();

                    for (int i = 0; i < liNoP; i++)
                    {
                        DateTime dt = StartDate.AddMonths(i);
                        KeyParameters.Clear();
                        KeyParameters.Add(new DatabaseParameter("Starting_Date", dt.ToString("MM/dd/yyyy")));
                        KeyParameters.Add(new DatabaseParameter("Closed", "0"));
                        KeyParameters.Add(new DatabaseParameter("Date_Locked", "0"));
                        KeyParameters.Add(new DatabaseParameter("CreatedUser", User.Identity.Name));
                        KeyParameters.Add(new DatabaseParameter("CreatedDate", DateTime.Now.ToString("MM/dd/yyyy")));

                        SqlHelper.InsertCommand(KeyParameters, "tbl_TimsheetPostingPeriod");
                        sqlList.Add(SqlHelper.SQL);
                    }

                    if (!(SqlHelper.ExecuteQuery(sqlList, Data.ConnectionString)))
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "OKErrors", "Main.setMasterMessage('" + SqlHelper.ErrMsg + "','');", true);
                    }
                    else
                    {
                        Response.Redirect("/TimeSheet/TimesheetPosting.aspx?year=" + ddl_Year.SelectedValue);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "OKErrors", "Main.setMasterMessage('Cannot Create Posting Period. It is existed','');", true);
                }
            }
        }
Exemple #5
0
        public OpCheckListHeaderCollection GetOpCheckListHeader()
        {
            OpCheckListHeaderCollection headers = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpCheckListHeader.ActualTableName);
                base.CurSQLFactory.SQL = base.CurSQLFactory.SQL + " Order By checklist_date";
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    headers = new OpCheckListHeaderCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        OpCheckListHeaderObj obj2 = new OpCheckListHeaderObj(row[this.DataStructrure.Tables.OpCheckListHeader.InternalID.ActualFieldName].ToString())
                        {
                            AcquisitionModelNo = row[this.DataStructrure.Tables.OpCheckListHeader.AcquisitaionModelNo.ActualFieldName].ToString(),
                            AcquisitionSN      = row[this.DataStructrure.Tables.OpCheckListHeader.AcquisitionModelSN.ActualFieldName].ToString(),
                            CheckListDate      = Convert.ToDateTime(row[this.DataStructrure.Tables.OpCheckListHeader.Date.ActualFieldName].ToString()),
                            HospitalName       = row[this.DataStructrure.Tables.OpCheckListHeader.HospitalName.ActualFieldName].ToString(),
                            ModelNo            = row[this.DataStructrure.Tables.OpCheckListHeader.ModelNo.ActualFieldName].ToString(),
                            Notification       = new OpNotificationObj(row[this.DataStructrure.Tables.OpCheckListHeader.NotificationID.ActualFieldName].ToString()),
                            SN = row[this.DataStructrure.Tables.OpCheckListHeader.SerialNo.ActualFieldName].ToString(),
                            TreadmillModelNo = row[this.DataStructrure.Tables.OpCheckListHeader.TreadmillModelNo.ActualFieldName].ToString(),
                            TreadmillSN      = row[this.DataStructrure.Tables.OpCheckListHeader.TreadmillSN.ActualFieldName].ToString(),
                            Department       = row[this.DataStructrure.Tables.OpCheckListHeader.Department.ActualFieldName].ToString(),
                            CheckListType    = row[this.DataStructrure.Tables.OpCheckListHeader.CheckListType.ActualFieldName].ToString()
                        };
                        headers.Add(obj2);
                    }
                    return(headers);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpCheckListHeaderManager] : GetOpCheckListHeaderByNotificationID : " + base.CurDBEngine.ErrorMessage;
                return(headers);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpCheckListHeaderManager] : GetOpCheckListHeaderByNotificationID : " + base.ErrMsg;
            return(headers);
        }
 public string CreateOpDamagesSQL(OpDamagesObj CurDamageObj)
 {
     if (this.TryConnection())
     {
         DatabaseParameters keys = new DatabaseParameters();
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.InternalID.ActualFieldName, CurDamageObj.InternalID));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName, CurDamageObj.Damage.InternalID.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageDescription.ActualFieldName, CurDamageObj.Description.Replace("'", "''"), true, true));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName, CurDamageObj.Damage.Code.InternalID.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageOrder.ActualFieldName, CurDamageObj.Order.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName, CurDamageObj.Notification.InternalID.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.OpSys.ActualFieldName, CurDamageObj.OpSys.ToString()));
         base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpDamages.ActualTableName);
         DisposeObjects();
         return(base.CurSQLFactory.SQL);
     }
     base.error_occured = true;
     base.ErrMsg        = base.ErrMsg + "[OpDamagesManager] : CreateOpDamages : " + base.ErrMsg;
     DisposeObjects();
     return("");
 }
Exemple #7
0
        public bool DeleteOpSurvey(string NotificationID)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSurvey.NotificationID.ActualFieldName, NotificationID));
                base.CurSQLFactory.DeleteCommand(keys, this.DataStructrure.Tables.OpSurvey.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpSurveyManager] : DeleteOpSurvey : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpSurveyManager] : DeleteOpSurvey : " + base.ErrMsg;
            return(flag);
        }
Exemple #8
0
 public string CreateOpQuotationDetailSQL(OpQuotationDetailObj CurOpQuotationDetailObj)
 {
     if (this.TryConnection())
     {
         DatabaseParameters keys = new DatabaseParameters();
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.InternalID.ActualFieldName, CurOpQuotationDetailObj.InternalID));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Description.ActualFieldName, CurOpQuotationDetailObj.Description.ToString().Replace("'", "''"), true, true));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailNo.ActualFieldName, CurOpQuotationDetailObj.DetailNo.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName, CurOpQuotationDetailObj.Quotation.InternalID.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Quantity.ActualFieldName, CurOpQuotationDetailObj.Quantity.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Rate.ActualFieldName, CurOpQuotationDetailObj.Rate.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Discount.ActualFieldName, CurOpQuotationDetailObj.Discount.ToString()));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.PartNo.ActualFieldName, CurOpQuotationDetailObj.PartNo.ToString().Replace("'", "''"), true, true));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.TotalPrice.ActualFieldName, CurOpQuotationDetailObj.TotalPrice.ToString()));
         base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
         return(base.CurSQLFactory.SQL);
     }
     base.error_occured = true;
     base.ErrMsg        = base.ErrMsg + "[OpQuotationDetailManager] : CreateOpQuotationDetail : " + base.ErrMsg;
     return("");
 }
Exemple #9
0
        public bool DeleteEquipment(string EquipmentID)
        {
            bool flag = true;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentID.ActualFieldName, EquipmentID));
                base.CurSQLFactory.DeleteCommand(keys, this.DataStructrure.Tables.MasterEquipment.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[EquipmentManager] : DeleteEquipment : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[EquipmentManager] : DeleteEquipment : " + base.ErrMsg;
            return(flag);
        }
Exemple #10
0
        public OpDamagesInCollection GetOpDamagesInColl(string EngineerID)
        {
            OpDamagesInCollection ins = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpDamages.ActualTableName);
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerOutstandingCompletedJobDamages.Param_EngineerID.ActualFieldName, EngineerID));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetEngineerOutstandingCompletedJobDamages.ActualTableName, parameters);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    ins = new OpDamagesInCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        OpDamages damages = new OpDamages(row[this.DataStructrure.Tables.OpDamages.InternalID.ActualFieldName].ToString())
                        {
                            damage_notification = row[this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName].ToString(),
                            damage_code         = row[this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName].ToString(),
                            damage_desc         = row[this.DataStructrure.Tables.OpDamages.DamageDescription.ActualFieldName].ToString(),
                            damage_group        = row[this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName].ToString(),
                            damage_order        = row[this.DataStructrure.Tables.OpDamages.DamageOrder.ActualFieldName].ToString(),
                            op_sys = row[this.DataStructrure.Tables.OpDamages.OpSys.ActualFieldName].ToString()
                        };
                        ins.Add(damages);
                    }
                    this.DisposeObjects();
                    return(ins);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpDamagesManager] : GetOpDamagesInColl : " + base.CurDBEngine.ErrorMessage;
                this.DisposeObjects();
                return(ins);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpDamagesManager] : GetOpDamagesInColl : " + base.ErrMsg;
            this.DisposeObjects();
            return(ins);
        }
Exemple #11
0
        public bool CreateOpQuotation(OpQuotationObj CurOpQuotation)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.InternalID.ActualFieldName, CurOpQuotation.InternalID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Currency.ActualFieldName, CurOpQuotation.Currency.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.EngineerID.ActualFieldName, CurOpQuotation.Engineer.InternalID.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Incoterm1.ActualFieldName, CurOpQuotation.Incoterms1.InternalID.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Incoterm2.ActualFieldName, CurOpQuotation.Incoterm2.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Notice.ActualFieldName, CurOpQuotation.Notice.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.NotificationID.ActualFieldName, CurOpQuotation.Notification.InternalID.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.PaymentTerm.ActualFieldName, CurOpQuotation.PaymentTerm.InternalID.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.QuotationNo.ActualFieldName, CurOpQuotation.QuotationNo.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Status.ActualFieldName, CurOpQuotation.Status.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.UserStatus.ActualFieldName, CurOpQuotation.UserStatus.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.DeliveryTerm.ActualFieldName, CurOpQuotation.DeliveryTerm));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Attn.ActualFieldName, CurOpQuotation.Attn));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.FaxEmail.ActualFieldName, CurOpQuotation.FaxEmail));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.QuotationDate.ActualFieldName, DateTime.Now));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.CustomerAddress.ActualFieldName, CurOpQuotation.CustomerAddress));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.CustomerName.ActualFieldName, CurOpQuotation.CustomerName));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.ValidityDays.ActualFieldName, CurOpQuotation.ValidityDays.ToString()));
                base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpQuotation.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpQuotationManager] : CreateOpQuotation : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                //DisposeObjects();
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpQuotationManager] : CreateOpQuotation : " + base.ErrMsg;
            //DisposeObjects();
            return(flag);
        }
Exemple #12
0
        public DataTable GetMasterCheckListRelation()
        {
            DataTable table = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.MasterCheckListRelation.ActualTableName);
                DataTable table2 = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table2 != null)
                {
                    table2.TableName = "master_checklist_relation";
                    return(table2);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListRelation : " + base.CurDBEngine.ErrorMessage;
                return(table);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListRelation : " + base.ErrMsg;
            return(table);
        }
Exemple #13
0
        public bool UpdatePassword(string UserInternalID, string Password)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys   = new DatabaseParameters();
                DatabaseParameters values = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.CurDataStructure.Tables.MasterUsers.InternalID.ActualFieldName, UserInternalID));
                values.Add(new DatabaseParameter(this.CurDataStructure.Tables.MasterUsers.Password.ActualFieldName, Password));
                base.CurSQLFactory.UpdateCommand(keys, values, this.CurDataStructure.Tables.MasterUsers.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    base.ErrMsg        = "[UserManager.UpdatePassword] : this.CurDBEngine.ExecuteQuery('" + base.CurSQLFactory.SQL + "') : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = "[UserManager.UpdatePassword] : " + base.ErrMsg;
            return(flag);
        }
Exemple #14
0
        public CustomerCollection GetAllCustomers()
        {
            CustomerCollection customers = null;

            if (this.TryConnection())
            {
                DatabaseParameters keyParameters = new DatabaseParameters();
                DataTable          table         = this.QueryData(keyParameters, this.DataStructrure.Tables.MasterCustomer.ActualTableName);
                if (table == null)
                {
                    return(customers);
                }
                customers = new CustomerCollection();
                foreach (DataRow row in table.Rows)
                {
                    CustomerObj obj2 = new CustomerObj(row[this.DataStructrure.Tables.MasterCustomer.CustomerID.ActualFieldName].ToString())
                    {
                        Name1        = row[this.DataStructrure.Tables.MasterCustomer.Name1.ActualFieldName].ToString(),
                        Name2        = row[this.DataStructrure.Tables.MasterCustomer.Name2.ActualFieldName].ToString(),
                        City         = row[this.DataStructrure.Tables.MasterCustomer.City.ActualFieldName].ToString(),
                        Country      = new CountryObj(row[this.DataStructrure.Tables.MasterCustomer.Country.ActualFieldName].ToString()),
                        Currency     = row[this.DataStructrure.Tables.MasterCustomer.Currency.ActualFieldName].ToString(),
                        DistrChannel = row[this.DataStructrure.Tables.MasterCustomer.DistrChannel.ActualFieldName].ToString(),
                        Division     = row[this.DataStructrure.Tables.MasterCustomer.DistrChannel.ActualFieldName].ToString(),
                        Fax          = row[this.DataStructrure.Tables.MasterCustomer.Fax.ActualFieldName].ToString(),
                        Incoterms1   = new IncotermsObj(row[this.DataStructrure.Tables.MasterCustomer.Incoterms.ActualFieldName].ToString()),
                        Incoterms2   = row[this.DataStructrure.Tables.MasterCustomer.Incoterms2.ActualFieldName].ToString(),
                        PaymentTerm  = new TermOfPaymentObj(row[this.DataStructrure.Tables.MasterCustomer.PaymentTerms.ActualFieldName].ToString()),
                        PO           = row[this.DataStructrure.Tables.MasterCustomer.PO.ActualFieldName].ToString(),
                        Region       = new RegionObj(row[this.DataStructrure.Tables.MasterCustomer.Region.ActualFieldName].ToString()),
                        SalesOrg     = row[this.DataStructrure.Tables.MasterCustomer.SalesOrg.ActualFieldName].ToString(),
                        Street       = row[this.DataStructrure.Tables.MasterCustomer.Street.ActualFieldName].ToString(),
                        Tel1         = row[this.DataStructrure.Tables.MasterCustomer.Tel.ActualFieldName].ToString()
                    };
                    customers.Add(obj2);
                }
            }
            return(customers);
        }
        public bool CreateOpQuotationDetail(OpQuotationDetailCollection ListOfOpQuotationDetailObj, string QuotationID)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                ArrayList          sqla        = new ArrayList();
                DatabaseParameters keys        = new DatabaseParameters();
                DatabaseParameters parameters2 = new DatabaseParameters();
                parameters2.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName, QuotationID));
                base.CurSQLFactory.DeleteCommand(parameters2, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
                sqla.Add(base.CurSQLFactory.SQL);
                foreach (OpQuotationDetailObj obj2 in ListOfOpQuotationDetailObj)
                {
                    keys.Clear();
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.InternalID.ActualFieldName, obj2.InternalID));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Description.ActualFieldName, obj2.Description.ToString().Replace("'", "''"), true, true));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailNo.ActualFieldName, obj2.DetailNo.ToString()));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName, obj2.Quotation.InternalID.ToString()));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Quantity.ActualFieldName, obj2.Quantity.ToString()));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Rate.ActualFieldName, obj2.Rate.ToString()));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.Discount.ActualFieldName, obj2.Discount.ToString()));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.PartNo.ActualFieldName, obj2.PartNo.ToString().Replace("'", "''"), true, true));
                    keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.TotalPrice.ActualFieldName, obj2.TotalPrice.ToString()));
                    base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
                    sqla.Add(base.CurSQLFactory.SQL);
                }
                if (!(flag = base.CurDBEngine.ExecuteQuery(sqla)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpQuotationDetailManager] : CreateOpQuotationDetail : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpQuotationDetailManager] : CreateOpQuotationDetail : " + base.ErrMsg;
            return(flag);
        }
Exemple #16
0
        public OpMessagesCollection GetMessageBySender(string sender_id)
        {
            OpMessagesCollection messagess = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Views.OpMessage.SenderID.ActualFieldName, sender_id));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Views.OpMessage.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if ((table == null) || (table.Rows.Count <= 0))
                {
                    return(messagess);
                }
                messagess = new OpMessagesCollection();
                foreach (DataRow row in table.Rows)
                {
                    messagess.Add(this.FillData(row));
                }
            }
            return(messagess);
        }
        public OpQuotationDetailCollection GetOpQuotationDetailByQuotationID(string QuotationID)
        {
            OpQuotationDetailCollection details = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName, QuotationID));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    details = new OpQuotationDetailCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        OpQuotationDetailObj obj2 = new OpQuotationDetailObj(row[this.DataStructrure.Tables.OpQuotationDetail.InternalID.ActualFieldName].ToString())
                        {
                            Description = row[this.DataStructrure.Tables.OpQuotationDetail.Description.ActualFieldName].ToString(),
                            DetailNo    = row[this.DataStructrure.Tables.OpQuotationDetail.DetailNo.ActualFieldName].ToString(),
                            Quantity    = Convert.ToInt32(row[this.DataStructrure.Tables.OpQuotationDetail.Quantity.ActualFieldName].ToString()),
                            Quotation   = new OpQuotationObj(row[this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName].ToString()),
                            Rate        = Convert.ToDouble(row[this.DataStructrure.Tables.OpQuotationDetail.Rate.ActualFieldName].ToString()),
                            Discount    = Convert.ToDouble(row[this.DataStructrure.Tables.OpQuotationDetail.Discount.ActualFieldName].ToString()),
                            Unit        = row[this.DataStructrure.Tables.OpQuotationDetail.Unit.ActualFieldName].ToString(),
                            PartNo      = row[this.DataStructrure.Tables.OpQuotationDetail.PartNo.ActualFieldName].ToString(),
                            TotalPrice  = Convert.ToDouble(row[this.DataStructrure.Tables.OpQuotationDetail.TotalPrice.ActualFieldName].ToString())
                        };
                        details.Add(obj2);
                    }
                    return(details);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByQuotationID : " + base.CurDBEngine.ErrorMessage;
                return(details);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByQuotationID : " + base.ErrMsg;
            return(details);
        }
        public bool Login(string sUserName, string sPassword)
        {
            bool               bIsValidUser     = false;
            string             sDecryptPassword = string.Empty;
            DatabaseAccess     oDBAccess        = null;
            DatabaseParameters oDBParameter     = null;
            DataTable          dt = new DataTable();

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@sUserName", sUserName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_getUserByUserName", oDBParameter, out dt);
                oDBAccess.CloseConnection(false);
                if (dt != null && dt.Rows.Count > 0)
                {
                    sDecryptPassword = clsEncryption.DecryptFromBase64String(Convert.ToString(dt.Rows[0]["sPassword"]));
                    if (sDecryptPassword == sPassword)
                    {
                        bIsValidUser          = true;
                        this.nUserID          = Convert.ToInt64(dt.Rows[0]["nUserID"]);
                        this.sName            = Convert.ToString(dt.Rows[0]["sName"]);
                        this.sUserName        = Convert.ToString(dt.Rows[0]["sUserName"]);
                        this.sUserDesignation = Convert.ToString(dt.Rows[0]["sUserDesignation"]);
                        this.bIsActive        = Convert.ToBoolean(dt.Rows[0]["bIsActive"]);
                    }
                }
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), "Rental System LoginSP", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(bIsValidUser);
        }
Exemple #19
0
        public LogsCollection GetActionLogByReffID(string InternalID)
        {
            LogsCollection logss = null;

            if (!this.IsReady)
            {
                base.CurDBEngine = new DatabaseEngine(this.DBType, this.Conn);
                if (this.IsReady = base.CurDBEngine.Connect())
                {
                    this.CurSQLFactory = new SQLFactory(this.DBType);
                }
            }
            if (this.IsReady)
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructure.Tables.LogActions.ReffID.ActualFieldName, InternalID));
                this.CurSQLFactory.SelectCommand(parameters, this.DataStructure.Tables.LogActions.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(this.CurSQLFactory.SQL);
                if (table != null)
                {
                    logss = new LogsCollection();
                    DataRow[] rowArray = table.Select("", this.DataStructure.Tables.LogActions.LogDateTime.ActualFieldName);
                    foreach (DataRow row in rowArray)
                    {
                        ActionLogItem item = new ActionLogItem {
                            ReffID            = row[this.DataStructure.Tables.LogActions.ReffID.ActualFieldName].ToString(),
                            LogDate           = Convert.ToDateTime(row[this.DataStructure.Tables.LogActions.LogDateTime.ActualFieldName]),
                            LoggedBy          = new ApplicationUser(row[this.DataStructure.Tables.LogActions.LogBy.ActualFieldName].ToString()),
                            ActionDescription = row[this.DataStructure.Tables.LogActions.Description.ActualFieldName].ToString()
                        };
                        logss.Add(item);
                    }
                    return(logss);
                }
                this.ErrMsg = "[LogManager.GetActionLogByReffID] : Failed at this.CurDBEngine.SelectQuery('" + this.CurSQLFactory.SQL + "') : " + base.CurDBEngine.ErrorMessage;
            }
            return(logss);
        }
Exemple #20
0
        public DataTable GetLocationInformation(Int64 nLocationID)
        {
            DataSet            ds           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nLocationID", nLocationID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_LocationDetails", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(_dt);
        }
Exemple #21
0
        public bool UpdateCustomer(CustomerObj NewCustomer)
        {
            bool flag = true;

            if (this.TryConnection())
            {
                DatabaseParameters values = new DatabaseParameters();
                DatabaseParameters keys   = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.CustomerID.ActualFieldName, NewCustomer.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Incoterms.ActualFieldName, NewCustomer.Incoterms1.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Incoterms2.ActualFieldName, NewCustomer.Incoterms2.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.City.ActualFieldName, NewCustomer.City.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Country.ActualFieldName, NewCustomer.Country.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Currency.ActualFieldName, NewCustomer.Currency.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.DistrChannel.ActualFieldName, NewCustomer.DistrChannel.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Division.ActualFieldName, NewCustomer.Division.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Fax.ActualFieldName, NewCustomer.Fax.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Name1.ActualFieldName, NewCustomer.Name1.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Name2.ActualFieldName, NewCustomer.Name2.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.PaymentTerms.ActualFieldName, NewCustomer.PaymentTerm.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.PO.ActualFieldName, NewCustomer.PO.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Region.ActualFieldName, NewCustomer.Region.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.SalesOrg.ActualFieldName, NewCustomer.SalesOrg.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Street.ActualFieldName, NewCustomer.Street.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCustomer.Tel.ActualFieldName, NewCustomer.Tel1.ToString()));
                base.CurSQLFactory.UpdateCommand(keys, values, this.DataStructrure.Tables.MasterCustomer.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[CustomerManager] : UpdateCustomer : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[CustomerManager] : UpdateCustomer : " + base.ErrMsg;
            return(flag);
        }
Exemple #22
0
        public bool InactivateOpQuotation(string InternalID)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters values = new DatabaseParameters();
                DatabaseParameters keys   = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.InternalID.ActualFieldName, InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.Status.ActualFieldName, "0"));
                base.CurSQLFactory.UpdateCommand(keys, values, this.DataStructrure.Tables.OpQuotation.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpQuotationManager] : InactivateOpQuotation : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpQuotationManager] : InactivateOpQuotation : " + base.ErrMsg;
            return(flag);
        }
Exemple #23
0
        public bool CreateMasterCheckListRelation(string CheckListTypeID, string dcchannel, string plant)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCheckListRelation.ChecklistType.ActualFieldName, CheckListTypeID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCheckListRelation.DistChannel.ActualFieldName, dcchannel));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCheckListRelation.PlantNo.ActualFieldName, plant));
                base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.MasterCheckListRelation.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[MasterCheckListManager] : CreateMasterCheckListRelation : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[MasterCheckListManager] : CreateMasterCheckListRelation : " + base.ErrMsg;
            return(flag);
        }
        public DataTable GetOpEngineerUtilHoursDataResult(int Year, string EmployeeID, int TargetHours, string EquipmentProfile, string DChannel, string Plant)
        {
            DataTable table = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_EngineerID.ActualFieldName, EmployeeID));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_TargetHour.ActualFieldName, TargetHours.ToString()));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_Year.ActualFieldName, Year.ToString()));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.ActualTableName, parameters);
                table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table == null)
                {
                    base.error_occured = true;
                    base.ErrMsg        = "[OpEngineerManager] : GetOpEngineerUtilHoursDataResult : " + base.CurDBEngine.ErrorMessage;
                }
                return(table);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpEngineerManager] : GetOpEngineerUtilHoursDataResult : " + base.ErrMsg;
            return(table);
        }
Exemple #25
0
        public DataTable GetOpDamages(string EngineerID)
        {
            DataTable table = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerOutstandingCompletedJobDamages.Param_EngineerID.ActualFieldName, EngineerID));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetEngineerOutstandingCompletedJobDamages.ActualTableName, parameters);
                table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table == null)
                {
                    base.error_occured = true;
                    base.ErrMsg        = "[OpDamagesManager] : GetOpDamages : " + base.CurDBEngine.ErrorMessage;
                    return(table);
                }
                table.TableName = "OpDamages";
                return(table);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpDamagesManager] : GetOpDamages : " + base.ErrMsg;
            return(table);
        }
Exemple #26
0
        public OpCausesObj GetOpCausesByInternalID(string InternalID)
        {
            OpCausesObj obj2 = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.InternalID.ActualFieldName, InternalID));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpCauses.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    if (table.Rows.Count == 1)
                    {
                        DataRow row = table.Rows[0];
                        obj2 = new OpCausesObj(row[this.DataStructrure.Tables.OpCauses.InternalID.ActualFieldName].ToString())
                        {
                            Notification = new OpNotificationObj(row[this.DataStructrure.Tables.OpCauses.NotificationID.ActualFieldName].ToString()),
                            Cause        = new MasterCauseObj(row[this.DataStructrure.Tables.OpCauses.CauseCode.ActualFieldName].ToString(), row[this.DataStructrure.Tables.OpCauses.CauseDescription.ActualFieldName].ToString(), new CauseGroupObj(row[this.DataStructrure.Tables.OpCauses.CauseGroup.ActualFieldName].ToString())),
                            Order        = Convert.ToInt32(row[this.DataStructrure.Tables.OpCauses.CauseOrder.ActualFieldName].ToString()),
                            OpSys        = Convert.ToInt32(row[this.DataStructrure.Tables.OpCauses.OpSys.ActualFieldName].ToString()),
                            Description  = row[this.DataStructrure.Tables.OpCauses.CauseDescription.ActualFieldName].ToString()
                        };
                    }
                    //DisposeObjects();
                    return(obj2);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpCausesManager] : GetOpCausesByInternalID : " + base.CurDBEngine.ErrorMessage;
                //DisposeObjects();
                return(obj2);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpCausesManager] : GetOpCausesByInternalID : " + base.ErrMsg;
            //DisposeObjects();
            return(obj2);
        }
Exemple #27
0
        public DataTable GetMasterTypeDataBbValue(Int32 nMasterType, string sSearchString = "")
        {
            DataTable          dt           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nMasterType", nMasterType, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@sSearchString", sSearchString, ParameterDirection.Input, SqlDbType.VarChar);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_AllMastersData_Search", oDBParameter, out dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }
            return(dt);
        }
        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);
                    }
                    this.DisposeObjects();
                    return(ins);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.CurDBEngine.ErrorMessage;
                this.DisposeObjects();
                return(ins);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterCheckListManager] : GetMasterCheckListInColl : " + base.ErrMsg;
            this.DisposeObjects();
            return(ins);
        }
Exemple #29
0
 public string CreateOpCheckListHeaderSQL(OpCheckListHeaderObj CurOpCheckListHeader)
 {
     if (this.TryConnection())
     {
         DatabaseParameters keys = new DatabaseParameters();
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.InternalID.ActualFieldName, CurOpCheckListHeader.InternalID));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.AcquisitaionModelNo.ActualFieldName, CurOpCheckListHeader.AcquisitionModelNo));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.AcquisitionModelSN.ActualFieldName, CurOpCheckListHeader.AcquisitionSN));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.Date.ActualFieldName, CurOpCheckListHeader.CheckListDate));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.HospitalName.ActualFieldName, CurOpCheckListHeader.HospitalName.Replace("'", "''"), true, true));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.ModelNo.ActualFieldName, CurOpCheckListHeader.ModelNo));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.NotificationID.ActualFieldName, CurOpCheckListHeader.Notification.InternalID));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.SerialNo.ActualFieldName, CurOpCheckListHeader.SN));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.TreadmillModelNo.ActualFieldName, CurOpCheckListHeader.TreadmillModelNo));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.TreadmillSN.ActualFieldName, CurOpCheckListHeader.TreadmillSN));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.Department.ActualFieldName, CurOpCheckListHeader.Department.Replace("'", "''"), true, true));
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.CheckListType.ActualFieldName, CurOpCheckListHeader.CheckListType));
         base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpCheckListHeader.ActualTableName);
         return(base.CurSQLFactory.SQL);
     }
     base.error_occured = true;
     base.ErrMsg        = base.ErrMsg + "[OpCheckListHeaderManager] : CreateOpCheckListHeader : " + base.ErrMsg;
     return("");
 }
        public bool CreateOpCheckListDetail(OpCheckListDetailObj CurOpCheckListDetail)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListDetail.InternalID.ActualFieldName, CurOpCheckListDetail.InternalID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListDetail.Answer.ActualFieldName, CurOpCheckListDetail.Answer.Replace("'", "''"), true, true));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListDetail.CheckListID.ActualFieldName, CurOpCheckListDetail.CheckListObj.InternalID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListDetail.HeaderID.ActualFieldName, CurOpCheckListDetail.OpCheckListHeader.InternalID));
                base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpCheckListDetail.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpCheckListHeaderManager] : CreateOpCheckListDetail : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpCheckListHeaderManager] : CreateOpCheckListDetail : " + base.ErrMsg;
            return(flag);
        }