Example #1
0
        public void Param(string searchtype, string searchvalue)
        {
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_r_GetTruckOverAll '" + searchtype + "'," + "'" + searchvalue + "'"));

            //DataTableReader drKey = dsKey.Tables[1].CreateDataReader();
            data = dsKey;
        }
        public void GetRepairMERemark(string pMechanicID, string pExpID)
        {
            string  strSQL = "exec sp_Get_RepairMERemark" + " '" + SExpID + "', '" + pMechanicID + "'";
            DataSet dsKey  = GenericFunc.DataSetFromMSSQL(Connection, strSQL);

            int results = dsKey.Tables[0].Rows.Count;


            if (results > 0)
            {
                dgvRemark.DataSource = null;

                if (this.dgvRemark.DataSource != null)
                {
                    this.dgvRemark.DataSource = null;
                }
                else
                {
                    this.dgvRemark.Rows.Clear();
                }

                foreach (DataRow row in dsKey.Tables[0].Rows)
                {
                    dgvRemark.Rows.Add(row["RemarkID"].ToString()
                                       , row["DateRemark"].ToString().Replace(" 12:00:00 AM", "")
                                       , row["Remark"].ToString().Replace(" 12:00:00 AM", "")
                                       );
                }
            }
        }
Example #3
0
        public void Param(string SearchType, string SearchValue, string SearchMonth, string SearchYear)
        {
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_r_GetProjectSiteMonthly '" + SearchType + "'," + "'" + SearchValue + "'," + "'" + SearchMonth + "'," + "'" + SearchYear + "'"));

            data      = dsKey;
            MonthYear = (SearchMonth == string.Empty ? " " : SearchMonth) + " " + (SearchYear == string.Empty ? " " : SearchYear);
        }
        public void Param(string SearchType, string SearchValue)
        {
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_r_GetProjectSiteOverAll '" + SearchType + "'," + "'" + SearchValue + "'"));

            //DataTableReader drKey = dsKey.Tables[1].CreateDataReader();
            data = dsKey;
            //MonthYear = (SearchMonth == string.Empty ? " " : SearchMonth) + " " + (SearchYear == string.Empty ? " " : SearchYear);
        }
Example #5
0
        public void Param(string ProjectId, string ProjectNo, string ProjectSite, string ProjectDate, string PMonth, string PYear)
        {
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_r_ProjectSiteM_Detail '" + ProjectId + "'," + "'" + ProjectNo + "'," + "'" + ProjectSite + "'," + "'" + ProjectDate + "'," + "'" + PMonth + "'," + "'" + PYear + "'"));

            data          = dsKey;
            MonthYear     = (PMonth == string.Empty ? " " : PMonth) + " " + (PYear == string.Empty ? " " : PYear);
            p_ProjectId   = ProjectNo;
            p_ProjectSite = ProjectSite;
            p_ProjectDate = ProjectDate;
        }
        public void Param(string pEquipmentNo, string pModel, string pPlateNo, string StartDate, string EndDate)
        {
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_Get_InfoAndMonitoring '" + pEquipmentNo + "'," + "'" + pModel + "'," + "'" + pPlateNo + "'," + "'" + StartDate + "'," + "'" + EndDate + "'"));

            datavalue   = dsKey;
            EquipmentNo = pEquipmentNo;
            Model       = pModel;
            PlateNo     = pPlateNo;


            TotalKm  = dsKey.Tables[1].Rows[0]["Kms_Used"].ToString();
            TotalHrs = dsKey.Tables[1].Rows[0]["Hrs_Used"].ToString();

            DateParam = (StartDate == string.Empty ? " " : StartDate.Replace(" 12:00:00 AM", "")) + " To " + (EndDate == string.Empty ? " " : EndDate.Replace(" 12:00:00 AM", ""));
        }
        public void GetRepairME()
        {
            string result;
            string strSQL = "exec sp_Get_RepairME" + " '" + SExpID + "'";
            //reader = GenericFunc.ExecuteReader(spName, Userid, parmcurrentpass, parmnewpass, parmpIPAddress);
            //DataTable data = new DataTable();
            //DataTableReader readesr = GenericFunc.MSsqlDataReader(Connection, strSQL);
            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, strSQL);

            int results = dsKey.Tables[0].Rows.Count;

            //if (readesr.Read())
            //{
            //    result = readesr["Name"].ToString();
            //    //strUsrBranch = reader["Branch"].ToString();
            //}

            if (results > 0)
            {
                dgvMechanic.DataSource = null;

                if (this.dgvMechanic.DataSource != null)
                {
                    this.dgvMechanic.DataSource = null;
                }
                else
                {
                    this.dgvMechanic.Rows.Clear();
                }


                foreach (DataRow row in dsKey.Tables[0].Rows)
                {
                    dgvMechanic.Rows.Add(row["MechanicID"].ToString()
                                         , row["IsComplete"].ToString()
                                         , row["Name"].ToString()
                                         );
                }
            }
        }
        public void Param(string pEquipmentNo, string pModel, string pPlateNo, DataTable DtUnitDetail, string userid)
        {
            CategoryParent();
            FuelCategory();

            string SEquipmentno = "'" + pEquipmentNo + "'";
            string SModel       = "'" + pModel + "'";
            string SPlateno     = "'" + pPlateNo + "'";
            string spName       = "sp_Get_TruckInfo";

            //SqlDataReader reader;

            //reader = monitoring.ExecuteReader(spName, SEquipmentno, SModel, SPlateno);

            //result = DtUnitDetail;

            //result.Load(reader);

            userlogin = userid;

            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_Get_TruckInfo '" + pEquipmentNo + "'," + "'" + pModel + "'," + "'" + pPlateNo + "'"));

            datavalue = dsKey;
            //DataTableReader drKey = dsKey.Tables[0].CreateDataReader();

            ////  NumberofTable = result.Rows[0]["NumberofTable"].ToString();
            //lblServiceId.Text = result.Rows[0]["ServiceID"].ToString();
            //cmbfuel.Text = result.Rows[0]["FuelType"].ToString();
            //txtPNModelName.Text = result.Rows[0]["PlateNo"].ToString();
            //txtEngineNo.Text = result.Rows[0]["EngineNo"].ToString();
            //txtChassisNo.Text = result.Rows[0]["ChassisNo"].ToString();
            //txtPiston.Text = result.Rows[0]["PistonDisplacement"].ToString();
            //txtCylinder.Text = result.Rows[0]["NoCylinder"].ToString();
            //txtEqpName.Text = result.Rows[0]["Model"].ToString();
            //cmbType.Text = result.Rows[0]["TruckType"].ToString();
            //txtMake.Text = result.Rows[0]["Make"].ToString();
            //txtSeries.Text = result.Rows[0]["Series"].ToString();
            //txtBodyType.Text = result.Rows[0]["BodyType"].ToString();
            //txtYearModel.Text = result.Rows[0]["YearModel"].ToString();
            //txtGrossWT.Text = result.Rows[0]["GrossWt"].ToString();
            //txtEqpNo.Text = result.Rows[0]["EquipmentNo"].ToString(); ;
            //cmbPurchase.Text = result.Rows[0]["StatusOfPurchase"].ToString(); ;
            //dtpPurchase.Text = result.Rows[0]["DateOfPurchase"].ToString(); ;
            //txtCRNo.Text = result.Rows[0]["CR_No"].ToString(); ;
            //txtSupplier.Text = result.Rows[0]["Supplier"].ToString(); ;
            //txtExisting.Text = result.Rows[0]["ExistingReadingKm"].ToString(); ;
            //txtMVFile.Text = result.Rows[0]["MVFile_No"].ToString(); ;
            //cmbMonth.Text = result.Rows[0]["Month_R_Expired"].ToString();
            //txtYear.Text = result.Rows[0]["Year_R_Expired"].ToString();
            //txtUnitPrice.Text = result.Rows[0]["UnitPrice"].ToString();
            //cmbType.Text = result.Rows[0]["Trucktype"].ToString();
            //txtCurrentReading.Text = result.Rows[0]["CurrentReading"].ToString();
            ////string[] SRegiter = pRegister.Split(' ');

            //CurrentReading = result.Rows[0]["CurrentReading"].ToString();
            //Price = result.Rows[0]["UnitPrice"].ToString();
            //TruckType = result.Rows[0]["Trucktype"].ToString();
            //FuelType = result.Rows[0]["FuelType"].ToString();
            //PlateNo = result.Rows[0]["PlateNo"].ToString();
            //EngineNo = result.Rows[0]["EngineNo"].ToString();
            //ChasisNo = result.Rows[0]["ChassisNo"].ToString();
            //PistonDis = result.Rows[0]["PistonDisplacement"].ToString();
            //NoCylinders = result.Rows[0]["NoCylinder"].ToString();
            //Model = result.Rows[0]["Model"].ToString();
            //Type = result.Rows[0]["TruckType"].ToString();
            //Make = result.Rows[0]["Make"].ToString();
            //Series = result.Rows[0]["Series"].ToString();
            //BodyType = result.Rows[0]["BodyType"].ToString();
            //YearModel = result.Rows[0]["YearModel"].ToString();
            //GrossWt = result.Rows[0]["GrossWt"].ToString();
            //EquipmentNo = result.Rows[0]["EquipmentNo"].ToString();
            //StatusofPurchase = result.Rows[0]["StatusOfPurchase"].ToString();
            //DateOfPurchase = result.Rows[0]["DateOfPurchase"].ToString();
            //CRNo = result.Rows[0]["CR_No"].ToString();
            //Supplier = result.Rows[0]["Supplier"].ToString();
            //ExistingRead = result.Rows[0]["ExistingReadingKm"].ToString();
            //MVFile = result.Rows[0]["MVFile_No"].ToString();
            //Register = result.Rows[0]["Month_R_Expired"].ToString() + " " + result.Rows[0]["Year_R_Expired"].ToString();

            ////////////

            //  NumberofTable = dsKey.Tables[0].Rows[0]["NumberofTable"].ToString();
            lblServiceId.Text      = dsKey.Tables[0].Rows[0]["ServiceID"].ToString();
            cmbfuel.Text           = dsKey.Tables[0].Rows[0]["FuelType"].ToString();
            txtPNModelName.Text    = dsKey.Tables[0].Rows[0]["PlateNo"].ToString();
            txtEngineNo.Text       = dsKey.Tables[0].Rows[0]["EngineNo"].ToString();
            txtChassisNo.Text      = dsKey.Tables[0].Rows[0]["ChassisNo"].ToString();
            txtPiston.Text         = dsKey.Tables[0].Rows[0]["PistonDisplacement"].ToString();
            txtCylinder.Text       = dsKey.Tables[0].Rows[0]["NoCylinder"].ToString();
            txtEqpName.Text        = dsKey.Tables[0].Rows[0]["Model"].ToString();
            cmbType.Text           = dsKey.Tables[0].Rows[0]["TruckType"].ToString();
            txtMake.Text           = dsKey.Tables[0].Rows[0]["Make"].ToString();
            txtSeries.Text         = dsKey.Tables[0].Rows[0]["Series"].ToString();
            txtBodyType.Text       = dsKey.Tables[0].Rows[0]["BodyType"].ToString();
            txtYearModel.Text      = dsKey.Tables[0].Rows[0]["YearModel"].ToString();
            txtGrossWT.Text        = dsKey.Tables[0].Rows[0]["GrossWt"].ToString();
            txtEqpNo.Text          = dsKey.Tables[0].Rows[0]["EquipmentNo"].ToString();;
            cmbPurchase.Text       = dsKey.Tables[0].Rows[0]["StatusOfPurchase"].ToString();;
            dtpPurchase.Text       = dsKey.Tables[0].Rows[0]["DateOfPurchase"].ToString();;
            txtCRNo.Text           = dsKey.Tables[0].Rows[0]["CR_No"].ToString();;
            txtSupplier.Text       = dsKey.Tables[0].Rows[0]["Supplier"].ToString();;
            txtExisting.Text       = dsKey.Tables[0].Rows[0]["ExistingReadingKm"].ToString();;
            txtMVFile.Text         = dsKey.Tables[0].Rows[0]["MVFile_No"].ToString();;
            cmbMonth.Text          = dsKey.Tables[0].Rows[0]["Month_R_Expired"].ToString();
            txtYear.Text           = dsKey.Tables[0].Rows[0]["Year_R_Expired"].ToString();
            txtUnitPrice.Text      = dsKey.Tables[0].Rows[0]["UnitPrice"].ToString();
            cmbType.Text           = dsKey.Tables[0].Rows[0]["Trucktype"].ToString();
            txtCurrentReading.Text = dsKey.Tables[0].Rows[0]["CurrentReading"].ToString();
            txtHourlyRate.Text     = dsKey.Tables[0].Rows[0]["HourlyRates"].ToString();
            txtkmltr.Text          = dsKey.Tables[0].Rows[0]["km_ltr"].ToString();
            //string[] SRegiter = pRegister.Split(' ');

            CurrentReading   = dsKey.Tables[0].Rows[0]["CurrentReading"].ToString();
            Price            = dsKey.Tables[0].Rows[0]["UnitPrice"].ToString();
            TruckType        = dsKey.Tables[0].Rows[0]["Trucktype"].ToString();
            FuelType         = dsKey.Tables[0].Rows[0]["FuelType"].ToString();
            PlateNo          = dsKey.Tables[0].Rows[0]["PlateNo"].ToString();
            EngineNo         = dsKey.Tables[0].Rows[0]["EngineNo"].ToString();
            ChasisNo         = dsKey.Tables[0].Rows[0]["ChassisNo"].ToString();
            PistonDis        = dsKey.Tables[0].Rows[0]["PistonDisplacement"].ToString();
            NoCylinders      = dsKey.Tables[0].Rows[0]["NoCylinder"].ToString();
            Model            = dsKey.Tables[0].Rows[0]["Model"].ToString();
            Type             = dsKey.Tables[0].Rows[0]["TruckType"].ToString();
            Make             = dsKey.Tables[0].Rows[0]["Make"].ToString();
            Series           = dsKey.Tables[0].Rows[0]["Series"].ToString();
            BodyType         = dsKey.Tables[0].Rows[0]["BodyType"].ToString();
            YearModel        = dsKey.Tables[0].Rows[0]["YearModel"].ToString();
            GrossWt          = dsKey.Tables[0].Rows[0]["GrossWt"].ToString();
            EquipmentNo      = dsKey.Tables[0].Rows[0]["EquipmentNo"].ToString();
            StatusofPurchase = dsKey.Tables[0].Rows[0]["StatusOfPurchase"].ToString();
            DateOfPurchase   = dsKey.Tables[0].Rows[0]["DateOfPurchase"].ToString();
            CRNo             = dsKey.Tables[0].Rows[0]["CR_No"].ToString();
            Supplier         = dsKey.Tables[0].Rows[0]["Supplier"].ToString();
            ExistingRead     = dsKey.Tables[0].Rows[0]["ExistingReadingKm"].ToString();
            MVFile           = dsKey.Tables[0].Rows[0]["MVFile_No"].ToString();
            HourlyRate       = dsKey.Tables[0].Rows[0]["HourlyRates"].ToString();
            Register         = dsKey.Tables[0].Rows[0]["Month_R_Expired"].ToString() + " " + dsKey.Tables[0].Rows[0]["Year_R_Expired"].ToString();
            kmsltr           = dsKey.Tables[0].Rows[0]["km_ltr"].ToString();


            string CountTire    = "";
            string CountBattery = "";

            CountTire    = dsKey.Tables[1].Rows[0]["CountTire"].ToString();
            CountBattery = dsKey.Tables[1].Rows[0]["CountBattery"].ToString();

            dgvTire.DataSource = null;

            if (this.dgvTire.DataSource != null)
            {
                this.dgvTire.DataSource = null;
            }
            else
            {
                this.dgvTire.Rows.Clear();
            }


            dgvBattery.DataSource = null;

            if (this.dgvBattery.DataSource != null)
            {
                this.dgvBattery.DataSource = null;
            }
            else
            {
                this.dgvBattery.Rows.Clear();
            }
            if (CountBattery != "0")
            {
                foreach (DataRow row in dsKey.Tables[3].Rows)
                {
                    dgvBattery.Rows.Add(row["BatteryID"].ToString()
                                        , row["AllocationNo"].ToString()
                                        , row["Item"].ToString()
                                        , row["SerialNo"].ToString()
                                        , row["PartsNo"].ToString()
                                        );
                }
            }
            if (CountTire != "0")
            {
                foreach (DataRow row in dsKey.Tables[2].Rows)
                {
                    dgvTire.Rows.Add(row["TireID"].ToString()
                                     , row["AllocationNo"].ToString()
                                     , row["Item"].ToString()
                                     , row["SerialNo"].ToString()
                                     , row["PartsNo"].ToString()
                                     );
                }
            }


            ///////

            /*
             * cmbfuel.Text = pFuelType;
             * txtPNModelName.Text = pPlateNo;
             * txtEngineNo.Text = pEngineNo;
             * txtChassisNo.Text = pChasisNo;
             * txtPiston.Text = pPistonDis;
             * txtCylinder.Text = pNoCylinders;
             * txtEqpName.Text = pModel;
             * cmbType.Text = pType;
             * txtMake.Text = pMake;
             * txtSeries.Text = pSeries;
             * txtBodyType.Text = pBodyType;
             * txtYearModel.Text = pYearModel;
             * txtGrossWT.Text = pGrossWt;
             * txtEqpNo.Text = pEquipmentNo;
             * cmbPurchase.Text = pStatusofPurchase;
             * dtpPurchase.Text = pDateOfPurchase;
             * txtCRNo.Text = pCRNo;
             * txtSupplier.Text = pSupplier;
             * txtExisting.Text = pExistingRead;
             * txtMVFile.Text = pMVFile;
             * cmbMonth.Text = SRegiter[0];
             * txtYear.Text = SRegiter[1];
             * //Year = pYear;
             * ///
             * FuelType = pFuelType;
             * PlateNo = pPlateNo;
             * EngineNo = pEngineNo;
             * ChasisNo = pChasisNo;
             * PistonDis = pPistonDis;
             * NoCylinders = pNoCylinders;
             * Model = pModel;
             * Type = pType;
             * Make = pMake;
             * Series = pSeries;
             * BodyType = pBodyType;
             * YearModel = pYearModel;
             * GrossWt = pGrossWt;
             * EquipmentNo = pEquipmentNo;
             * StatusofPurchase = pStatusofPurchase;
             * DateOfPurchase = pDateOfPurchase;
             * CRNo = pCRNo;
             * Supplier = pSupplier;
             * ExistingRead = pExistingRead;
             * MVFile = pMVFile;
             * Register = pRegister;
             */
        }
Example #9
0
        public void Param(string pExpID, string pUserId, DataTable CategoryAll, string pServiceID, string pDate)
        {
            IsCancel   = "1";
            SExpID     = pExpID;
            SUserID    = pUserId;
            SServiceID = pServiceID;
            SDate      = pDate;


            dgvcmdCategory.HeaderText = "CATEGORY";
            dgvcmdCategory.Name       = "category";

            ArrayList categoryL = new ArrayList();

            foreach (DataRow dr in CategoryAll.Rows)
            {
                categoryL.Add(dr["Sub-Category"].ToString());
            }


            dgvcmdCategory.Items.AddRange(categoryL.ToArray());
            dgvItem.Columns.Add(dgvcmdCategory);
            dgvItem.Columns[14].Width = 177;


            DataSet dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_Get_RepairAndMaintenanceItem '" + SExpID + "'"));

            int vw_ItemExpenses = dsKey.Tables[0].Rows.Count;

            dgvItem.DataSource = null;

            if (this.dgvItem.DataSource != null)
            {
                this.dgvItem.DataSource = null;
            }
            else
            {
                this.dgvItem.Rows.Clear();
            }


            if (vw_ItemExpenses > 0)
            {
                foreach (DataRow row in dsKey.Tables[0].Rows)
                {
                    dgvItem.Rows.Add(row["SourceID"].ToString()
                                     //   , "false"
                                     , row["Qty"].ToString()
                                     , row["Item"].ToString()
                                     , row["IsPurchase"].ToString()
                                     , String.Format("{0:#,###.00}", Convert.ToDecimal(row["PMS"]))    //row["PMS"].ToString()
                                     , String.Format("{0:#,###.00}", Convert.ToDecimal(row["Repair"])) //row["Repair"].ToString()
                                     , String.Format("{0:#,###.00}", Convert.ToDecimal(row["Tire"]))   //row["Tire"].ToString()
                                     , row["PartsNo"].ToString()
                                     , row["SerialNo"].ToString()
                                     , row["ReferenceNo"].ToString()
                                     , row["AllocationNo"].ToString()
                                     , row["DateOfPurchase"].ToString().Replace(" 12:00:00 AM", "")
                                     , row["DateCompleted"].ToString().Replace(" 12:00:00 AM", "")
                                     //  , row["Category"].ToString()
                                     , row["Source"].ToString()
                                     , row["SubCategory"].ToString()
                                     //  , row["Approval"].ToString()
                                     );
                }
            }
        }
Example #10
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string Value         = "";
            string Number        = " ";
            string NumberofTable = " ";
            string EquipmentNo   = " ";
            string EquipmentName = " ";
            string NumberName    = " ";
            string Truckid       = " ";
            string IsMaintenance = " ";
            string TotalUsed     = " ";
            string Trucktype     = " ";
            string main          = "";

            //Enter Equipment No Or Plate No./Model Name

            /*
             * if (rdEqpNo.Checked)
             * {
             *  Value = "EquipmentNo";
             * }
             * else
             * {
             *  Value = "ModelName";
             * }
             */
            Value = "EquipmentNo";

            Number = txtEnternumber.Text;
            if (Number == " " || Number == "" || Number == null)
            {
                MessageBox.Show("Please Enter Equipment No Or Plate No./Model Name");
            }
            else
            {
                DialogResult dialogResult = MessageBox.Show("Please Click Yes to Continue", "Search", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    DataSet         dsKey = GenericFunc.DataSetFromMSSQL(Connection, ("exec sp_Get_InfoAndMonitoring '" + Value + "'," + "'" + Number + "'"));
                    DataTableReader drKey = dsKey.Tables[0].CreateDataReader();
                    if (drKey.Read())
                    {
                        NumberofTable = dsKey.Tables[0].Rows[0]["NumberofTable"].ToString();
                        main          = dsKey.Tables[0].Rows[0]["maintable"].ToString();

                        if (NumberofTable == "0")
                        {
                            MessageBox.Show("Record Not Found. Please check Equipment No Or Plate No./Model Name.");
                        }
                        else
                        {
                            if (main != "0")
                            {
                                IsMaintenance = dsKey.Tables[1].Rows[0]["IsMaintenance"].ToString();
                                TotalUsed     = dsKey.Tables[1].Rows[0]["TotalUsed"].ToString();

                                EquipmentNo   = dsKey.Tables[2].Rows[0]["EquipmentNo"].ToString();
                                EquipmentName = dsKey.Tables[2].Rows[0]["Model"].ToString();
                                NumberName    = dsKey.Tables[2].Rows[0]["PlateNo"].ToString();
                                Truckid       = dsKey.Tables[2].Rows[0]["TruckId"].ToString();
                                Trucktype     = dsKey.Tables[2].Rows[0]["Trucktype"].ToString();

                                AddMonitoring monitoring = new AddMonitoring();
                                monitoring.Param(EquipmentNo, EquipmentName, NumberName, Truckid, dsKey.Tables[3], NumberofTable, Value, TotalUsed, IsMaintenance, formtype, Trucktype);
                                this.Hide();
                                monitoring.ShowDialog(this);
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("Record Not Found. Please check Equipment No Or Plate No./Model Name.");
                            }
                        }
                    }
                    else
                    {
                    }
                }
            }
        }