Beispiel #1
0
        public DataTable GetOpSurveyDataResult(int Month, int Year, string dchannel, string plant, string EngineerID, string EquipmentProfile)
        {
            DataTable table = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_DChannel.ActualFieldName, dchannel));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_Plant.ActualFieldName, plant));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_Month.ActualFieldName, Month.ToString()));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_Year.ActualFieldName, Year.ToString()));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_EngineerID.ActualFieldName, EngineerID));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.Param_EquipmentProfile.ActualFieldName, EquipmentProfile));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetSurveyRatingByMonthYear.ActualTableName, parameters);
                table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table == null)
                {
                    base.error_occured = true;
                    base.ErrMsg        = "[OpSurveyManager] : GetOpSurveyDataResult : " + base.CurDBEngine.ErrorMessage;
                }
                return(table);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpSurveyManager] : GetOpSurveyDataResult : " + base.ErrMsg;
            return(table);
        }
Beispiel #2
0
        public bool CreateOpSignature(OpSignatureObj CurOpSignature)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.NotificationID.ActualFieldName, CurOpSignature.Notification.InternalID.ToString()));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.Signature.ActualFieldName, CurOpSignature.InternalID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.Name.ActualFieldName, CurOpSignature.Name.Replace("'", "''"), true, true));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.Contact.ActualFieldName, CurOpSignature.Contact.Replace("'", "''"), true, true));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.Department.ActualFieldName, CurOpSignature.Department.Replace("'", "''"), true, true));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpSignature.Designation.ActualFieldName, CurOpSignature.Designation.Replace("'", "''"), true, true));
                base.CurSQLFactory.InsertCommand(keys, this.DataStructrure.Tables.OpSignature.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpSignatureManager] : CreateOpSignature : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpSignatureManager] : CreateOpSignature : " + base.ErrMsg;
            return(flag);
        }
Beispiel #3
0
        public bool UpdateOpDamages(OpDamagesObj CurDamageObj)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters values = new DatabaseParameters();
                DatabaseParameters keys   = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.InternalID.ActualFieldName, CurDamageObj.InternalID));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName, CurDamageObj.Damage.InternalID.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageDescription.ActualFieldName, CurDamageObj.Description.Replace("'", "''"), true, true));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName, CurDamageObj.Damage.Code.InternalID.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageOrder.ActualFieldName, CurDamageObj.Order.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName, CurDamageObj.Notification.InternalID.ToString()));
                values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.OpSys.ActualFieldName, CurDamageObj.OpSys.ToString()));
                base.CurSQLFactory.UpdateCommand(keys, values, this.DataStructrure.Tables.OpDamages.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpDamagesManager] : UpdateOpDamages : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpDamagesManager] : UpdateOpDamages : " + base.ErrMsg;
            return(flag);
        }
Beispiel #4
0
        protected bool UpdateDirectExpense()
        {
            bool smooth = true;

            if (DataValidation())
            {
                ArrayList          sqlList       = new ArrayList();
                DatabaseParameters KeyParameters = new DatabaseParameters();
                CultureInfo        ivC           = new CultureInfo("es-US");
                DateTime           lfromdate     = Convert.ToDateTime(txtFromDate.Text, ivC);
                DateTime           ltodate       = Convert.ToDateTime(txtToDate.Text, ivC);

                // now insert new
                if (this.FileLines != null)
                {
                    // Delete data before import new
                    lfromdate = Convert.ToDateTime(txtFromDate.Text, ivC);
                    ltodate   = Convert.ToDateTime(txtToDate.Text, ivC);

                    KeyParameters.Add(new DatabaseParameter("CONVERT(VARCHAR(8), [Date], 112)", lfromdate.ToString("yyyyMMdd"), DBDataType.String, DBLinkage.AND, DBCompareType.LargerNEqual));
                    KeyParameters.Add(new DatabaseParameter("CONVERT(VARCHAR(8), [Date], 112)", ltodate.ToString("yyyyMMdd"), DBDataType.String, DBLinkage.AND, DBCompareType.SmallerNEqual));
                    // delete before insert
                    SqlHelper.DeleteCommand(KeyParameters, "tbl_DirectExpense");
                    sqlList.Add(SqlHelper.SQL);

                    for (int x = 1; x < this.FileLines.Count; x++)
                    {
                        string[] rowData = FileLines[x].ToString().Split(',');
                        KeyParameters.Clear();
                        string lsID = Guid.NewGuid().ToString();
                        KeyParameters.Add(new DatabaseParameter("internal_id", lsID));
                        KeyParameters.Add(new DatabaseParameter("PrjCode", rowData[0]));
                        KeyParameters.Add(new DatabaseParameter("Date", Convert.ToDateTime(rowData[1], ivC)));
                        KeyParameters.Add(new DatabaseParameter("Amount", rowData[2]));
                        KeyParameters.Add(new DatabaseParameter("SAPB1DB", "UserImported"));

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

                if (!(smooth = SqlHelper.ExecuteQuery(sqlList, Data.ConnectionString)))
                {
                    StatusLabel.Text = SqlHelper.ErrMsg;
                }
                else
                {
                    Response.Redirect("/TimeSheet/DirectExpenseEntry.aspx?fromdate=" + lfromdate.ToString("MM/dd/yyyy") + "&todate=" + ltodate.ToString("MM/dd/yyyy"));
                    Binding();
                    StatusLabel.Text = "Import Direct Expense Entry Successful.";
                }
            }

            return(smooth);
        }
Beispiel #5
0
        public bool CreateNewEquipment(EquipmentObj NewEquipment)
        {
            bool flag = true;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentID.ActualFieldName, NewEquipment.InternalID));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentDescription.ActualFieldName, NewEquipment.Description));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentObject.ActualFieldName, NewEquipment.EquipmentObject));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.Equipmentsnr.ActualFieldName, NewEquipment.EquipmentSNR));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentLocation.ActualFieldName, NewEquipment.EquipmentLocation));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName, NewEquipment.EquipmentProfileID));
                base.CurSQLFactory.InsertCommand(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 + "[CustomerManager] : CreateNewEquipment : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[CustomerManager] : CreateNewEquipment : " + base.ErrMsg;
            return(flag);
        }
Beispiel #6
0
        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()));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_EquipmentProfile.ActualFieldName, EquipmentProfile));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_DChannel.ActualFieldName, DChannel));
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetEngineerUtilHours.Param_Plant.ActualFieldName, Plant));
                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);
        }
Beispiel #7
0
        public bool DeleteOpDamages(string DamageCode, string DamageGroup, string NotificationId)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName, DamageCode));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName, DamageGroup));
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName, NotificationId));
                base.CurSQLFactory.DeleteCommand(keys, this.DataStructrure.Tables.OpDamages.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpDamagesManager] : DeleteOpDamages : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpDamagesManager] : DeleteOpDamages : " + base.ErrMsg;
            return(flag);
        }
Beispiel #8
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);
        }
Beispiel #9
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);
        }
Beispiel #10
0
        public OpQuotationCollection GetOpQuotationHeaderByEngineerForUnfinishJobs(string EngineerID)
        {
            OpQuotationCollection quotations = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetQuotationHeaderByEngineerForUnfinishJob.Param_EngineerID.ActualFieldName, EngineerID));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetQuotationHeaderByEngineerForUnfinishJob.ActualTableName, parameters);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    quotations = new OpQuotationCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        OpQuotationObj obj2 = new OpQuotationObj(row[this.DataStructrure.Tables.OpQuotation.InternalID.ActualFieldName].ToString())
                        {
                            Currency        = row[this.DataStructrure.Tables.OpQuotation.Currency.ActualFieldName].ToString(),
                            Incoterm2       = row[this.DataStructrure.Tables.OpQuotation.Incoterm2.ActualFieldName].ToString(),
                            Incoterms1      = new IncotermsObj(row[this.DataStructrure.Tables.OpQuotation.Incoterm2.ActualFieldName].ToString()),
                            Notice          = row[this.DataStructrure.Tables.OpQuotation.Notice.ActualFieldName].ToString(),
                            Notification    = new OpNotificationObj(row[this.DataStructrure.Tables.OpQuotation.NotificationID.ActualFieldName].ToString()),
                            PaymentTerm     = new TermOfPaymentObj(row[this.DataStructrure.Tables.OpQuotation.PaymentTerm.ActualFieldName].ToString()),
                            QuotationNo     = row[this.DataStructrure.Tables.OpQuotation.QuotationNo.ActualFieldName].ToString(),
                            Status          = Convert.ToInt32(row[this.DataStructrure.Tables.OpQuotation.Status.ActualFieldName].ToString()),
                            UserStatus      = row[this.DataStructrure.Tables.OpQuotation.UserStatus.ActualFieldName].ToString(),
                            DeliveryTerm    = row[this.DataStructrure.Tables.OpQuotation.DeliveryTerm.ActualFieldName].ToString(),
                            Attn            = row[this.DataStructrure.Tables.OpQuotation.Attn.ActualFieldName].ToString(),
                            FaxEmail        = row[this.DataStructrure.Tables.OpQuotation.FaxEmail.ActualFieldName].ToString(),
                            QuoteDate       = Convert.ToDateTime(row[this.DataStructrure.Tables.OpQuotation.QuotationDate.ActualFieldName].ToString()),
                            CustomerName    = row[this.DataStructrure.Tables.OpQuotation.CustomerName.ActualFieldName].ToString(),
                            CustomerAddress = row[this.DataStructrure.Tables.OpQuotation.CustomerAddress.ActualFieldName].ToString(),
                            ValidityDays    = int.Parse(row[this.DataStructrure.Tables.OpQuotation.ValidityDays.ActualFieldName].ToString())
                        };
                        quotations.Add(obj2);
                    }
                    this.DisposeObjects();
                    return(quotations);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpQuotationManager] : GetOpQuotation : " + base.CurDBEngine.ErrorMessage;
                this.DisposeObjects();
                return(quotations);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpQuotationManager] : GetOpQuotation : " + base.ErrMsg;
            this.DisposeObjects();
            return(quotations);
        }
        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);
        }
Beispiel #12
0
        public OpDamagesObj GetOpDamagesByDamageCodeDamageGrpNotificationID(string DamageCode, string DamageGroup, string NotificationID)
        {
            OpDamagesObj obj2 = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName, DamageCode));
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName, DamageGroup));
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName, NotificationID));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpDamages.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    if (table.Rows.Count == 1)
                    {
                        DataRow row = table.Rows[0];
                        obj2 = new OpDamagesObj(row[this.DataStructrure.Tables.OpDamages.InternalID.ActualFieldName].ToString())
                        {
                            Notification = new OpNotificationObj(row[this.DataStructrure.Tables.OpDamages.NotificationID.ActualFieldName].ToString()),
                            Damage       = new MasterDamageObj(row[this.DataStructrure.Tables.OpDamages.DamageCode.ActualFieldName].ToString(), row[this.DataStructrure.Tables.OpDamages.DamageDescription.ActualFieldName].ToString(), new DamageGroupObj(row[this.DataStructrure.Tables.OpDamages.DamageGroup.ActualFieldName].ToString())),
                            Order        = Convert.ToInt32(row[this.DataStructrure.Tables.OpDamages.DamageOrder.ActualFieldName].ToString()),
                            OpSys        = Convert.ToInt32(row[this.DataStructrure.Tables.OpDamages.OpSys.ActualFieldName].ToString()),
                            Description  = row[this.DataStructrure.Tables.OpDamages.DamageDescription.ActualFieldName].ToString()
                        };
                    }
                    return(obj2);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpDamagesManager] : GetOpDamagesByInternalID : " + base.CurDBEngine.ErrorMessage;
                return(obj2);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpDamagesManager] : GetOpDamagesByInternalID : " + base.ErrMsg;
            return(obj2);
        }
Beispiel #13
0
        public MasterCheckListCollection GetActiveMasterCheckListByType(string CheckListType)
        {
            MasterCheckListCollection lists = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCheckList.CheckListType.ActualFieldName, CheckListType));
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.MasterCheckList.CheckListActive.ActualFieldName, "1"));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.MasterCheckList.ActualTableName);
                base.CurSQLFactory.SQL = base.CurSQLFactory.SQL + " Order By checklist_seq";
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    lists = new MasterCheckListCollection();
                    foreach (DataRow row in table.Rows)
                    {
                        MasterCheckListObj obj2 = new MasterCheckListObj(row[this.DataStructrure.Tables.MasterCheckList.InternalID.ActualFieldName].ToString())
                        {
                            Question = row[this.DataStructrure.Tables.MasterCheckList.ChecklistQuestion.ActualFieldName].ToString(),
                            Type     = row[this.DataStructrure.Tables.MasterCheckList.CheckListType.ActualFieldName].ToString(),
                            Active   = row[this.DataStructrure.Tables.MasterCheckList.CheckListActive.ActualFieldName].ToString().CompareTo("0") == 0,
                            Seq      = Convert.ToInt32(row[this.DataStructrure.Tables.MasterCheckList.CheckListSeq.ActualFieldName].ToString())
                        };
                        lists.Add(obj2);
                    }
                    return(lists);
                }
                base.error_occured = true;
                base.ErrMsg        = "[MasterCheckListManager] : GetActiveMasterCheckListByType : " + base.CurDBEngine.ErrorMessage;
                return(lists);
            }
            base.error_occured = true;
            base.ErrMsg        = "[MasterCheckListManager] : GetActiveMasterCheckListByType : " + base.ErrMsg;
            return(lists);
        }
Beispiel #14
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("");
 }
        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);
        }
Beispiel #16
0
        public ApplicationUser GetMasterUsersByInternalID(string internalId)
        {
            ApplicationUser user = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.CurDataStructure.Tables.MasterUsers.InternalID.ActualFieldName, internalId));
                base.CurSQLFactory.SelectCommand(parameters, this.CurDataStructure.Tables.MasterUsers.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if ((table != null) && (table.Rows.Count == 1))
                {
                    user = this.FillUserData(table.Rows[0], true);
                }
            }
            return(user);
        }
Beispiel #17
0
        public OpQuotationObj GetOpQuotationByQuotationNo(string QuotationNo)
        {
            OpQuotationObj obj2 = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotation.QuotationNo.ActualFieldName, QuotationNo));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpQuotation.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    if (table.Rows.Count == 1)
                    {
                        DataRow row = table.Rows[0];
                        obj2 = new OpQuotationObj(row[this.DataStructrure.Tables.OpQuotation.InternalID.ActualFieldName].ToString())
                        {
                            Currency        = row[this.DataStructrure.Tables.OpQuotation.Currency.ActualFieldName].ToString(),
                            Incoterm2       = row[this.DataStructrure.Tables.OpQuotation.Incoterm2.ActualFieldName].ToString(),
                            Incoterms1      = new IncotermsObj(row[this.DataStructrure.Tables.OpQuotation.Incoterm2.ActualFieldName].ToString()),
                            Notice          = row[this.DataStructrure.Tables.OpQuotation.Notice.ActualFieldName].ToString(),
                            Notification    = new OpNotificationObj(row[this.DataStructrure.Tables.OpQuotation.NotificationID.ActualFieldName].ToString()),
                            PaymentTerm     = new TermOfPaymentObj(row[this.DataStructrure.Tables.OpQuotation.PaymentTerm.ActualFieldName].ToString()),
                            QuotationNo     = row[this.DataStructrure.Tables.OpQuotation.QuotationNo.ActualFieldName].ToString(),
                            Status          = Convert.ToInt32(row[this.DataStructrure.Tables.OpQuotation.Status.ActualFieldName].ToString()),
                            UserStatus      = row[this.DataStructrure.Tables.OpQuotation.UserStatus.ActualFieldName].ToString(),
                            DeliveryTerm    = row[this.DataStructrure.Tables.OpQuotation.DeliveryTerm.ActualFieldName].ToString(),
                            Attn            = row[this.DataStructrure.Tables.OpQuotation.Attn.ActualFieldName].ToString(),
                            FaxEmail        = row[this.DataStructrure.Tables.OpQuotation.FaxEmail.ActualFieldName].ToString(),
                            QuoteDate       = Convert.ToDateTime(row[this.DataStructrure.Tables.OpQuotation.QuotationDate.ActualFieldName].ToString()),
                            CustomerAddress = row[this.DataStructrure.Tables.OpQuotation.CustomerAddress.ActualFieldName].ToString(),
                            CustomerName    = row[this.DataStructrure.Tables.OpQuotation.CustomerName.ActualFieldName].ToString(),
                            ValidityDays    = int.Parse(row[this.DataStructrure.Tables.OpQuotation.ValidityDays.ActualFieldName].ToString())
                        };
                    }
                    return(obj2);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpQuotationManager] : GetOpQuotationByQuotationNo : " + base.CurDBEngine.ErrorMessage;
                return(obj2);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpQuotationManager] : GetOpQuotationByQuotationNo : " + base.ErrMsg;
            return(obj2);
        }
        public OpQuotationDetailCollection GetOpQuotationDetailByEngineerForUnifinishJobs(string EngineerID)
        {
            OpQuotationDetailCollection details = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.StoredProcedures.GetQuotationDetailByEngineerForUnfinishJob.Param_EngineerID.ActualFieldName, EngineerID));
                base.CurSQLFactory.ExecuteStoredProcedure(this.DataStructrure.StoredProcedures.GetQuotationDetailByEngineerForUnfinishJob.ActualTableName, parameters);
                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);
                    }
                    this.DisposeObjects();
                    return(details);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByQuotationID : " + base.CurDBEngine.ErrorMessage;
                this.DisposeObjects();
                return(details);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByQuotationID : " + base.ErrMsg;
            this.DisposeObjects();
            return(details);
        }
Beispiel #19
0
        public OpCheckListHeaderCollection GetOpCheckListHeaderByNotificationID(string NotificationId)
        {
            OpCheckListHeaderCollection headers = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.NotificationID.ActualFieldName, NotificationId));
                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);
        }
Beispiel #20
0
        public Int64 GetSequenceNumber(int nMasterType)
        {
            Int64              nSequencNo   = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nMasterType", nMasterType, ParameterDirection.Input, SqlDbType.Int);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_SequenceNo", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    nSequencNo = Convert.ToInt64(_dt.Rows[0][0]);
                }
            }
            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(nSequencNo);
        }
Beispiel #21
0
 public string UpdateOpCausesSQL(OpCausesObj CurCausesObj)
 {
     if (this.TryConnection())
     {
         DatabaseParameters values = new DatabaseParameters();
         DatabaseParameters keys   = new DatabaseParameters();
         keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.InternalID.ActualFieldName, CurCausesObj.InternalID));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.CauseCode.ActualFieldName, CurCausesObj.Cause.InternalID.ToString()));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.CauseDescription.ActualFieldName, CurCausesObj.Description.Replace("'", "''"), true, true));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.CauseGroup.ActualFieldName, CurCausesObj.Cause.Code.InternalID.ToString()));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.CauseOrder.ActualFieldName, CurCausesObj.Order.ToString()));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.NotificationID.ActualFieldName, CurCausesObj.Notification.InternalID.ToString()));
         values.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCauses.OpSys.ActualFieldName, CurCausesObj.OpSys.ToString()));
         base.CurSQLFactory.UpdateCommand(keys, values, this.DataStructrure.Tables.OpCauses.ActualTableName);
         return(base.CurSQLFactory.SQL);
     }
     base.error_occured = true;
     base.ErrMsg        = base.ErrMsg + "[OpCausesManager] : UpdateOpCauses : " + base.ErrMsg;
     return("");
 }
        public bool DeleteOpQuotationDetailByQuotationID(string QuotationID)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.DetailQuotation.ActualFieldName, QuotationID));
                base.CurSQLFactory.DeleteCommand(keys, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
                if (!(flag = base.CurDBEngine.ExecuteQuery(base.CurSQLFactory.SQL)))
                {
                    base.error_occured = true;
                    string errMsg = base.ErrMsg;
                    base.ErrMsg = errMsg + "[OpQuotationDetailManager] : DeleteOpQuotationDetailByQuotationID : " + base.CurSQLFactory.SQL + " : " + base.CurDBEngine.ErrorMessage;
                }
                return(flag);
            }
            base.error_occured = true;
            base.ErrMsg        = base.ErrMsg + "[OpQuotationDetailManager] : DeleteOpQuotationDetailByQuotationID : " + base.ErrMsg;
            return(flag);
        }
Beispiel #23
0
        public bool DeleteOpCheckListHeader(string InternalID)
        {
            bool flag = false;

            if (this.TryConnection())
            {
                DatabaseParameters keys = new DatabaseParameters();
                keys.Add(new DatabaseParameter(this.DataStructrure.Tables.OpCheckListHeader.InternalID.ActualFieldName, InternalID));
                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);
        }
Beispiel #24
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);
        }
Beispiel #25
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);
        }
Beispiel #26
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);
        }
Beispiel #27
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);
        }
        public OpQuotationDetailObj GetOpQuotationDetailByInternalID(string InternalID)
        {
            OpQuotationDetailObj obj2 = null;

            if (this.TryConnection())
            {
                DatabaseParameters parameters = new DatabaseParameters();
                parameters.Add(new DatabaseParameter(this.DataStructrure.Tables.OpQuotationDetail.InternalID.ActualFieldName, InternalID));
                base.CurSQLFactory.SelectCommand(parameters, this.DataStructrure.Tables.OpQuotationDetail.ActualTableName);
                DataTable table = base.CurDBEngine.SelectQuery(base.CurSQLFactory.SQL);
                if (table != null)
                {
                    if (table.Rows.Count == 1)
                    {
                        DataRow row = table.Rows[0];
                        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())
                        };
                    }
                    return(obj2);
                }
                base.error_occured = true;
                base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByInternalID : " + base.CurDBEngine.ErrorMessage;
                return(obj2);
            }
            base.error_occured = true;
            base.ErrMsg        = "[OpQuotationDetailManager] : GetOpQuotationDetailByInternalID : " + base.ErrMsg;
            return(obj2);
        }
Beispiel #29
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);
        }
Beispiel #30
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);
        }