예제 #1
0
        public void GetTransportOperationInfoByID(int Tr_FuelID)
        {
            transportdata = new TransportData();
            DS            = transportdata.GetVehicleFuelDetailsInfoByID(Tr_FuelID);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                dpVehicleNo.ClearSelection();
                if (dpVehicleNo.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["TM_Id"]).ToString()) != null)
                {
                    dpVehicleNo.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["TM_Id"]).ToString()).Selected = true;
                }
                dpRegisterpump.ClearSelection();
                if (dpRegisterpump.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["RegisterdPump"]).ToString()) != null)
                {
                    dpRegisterpump.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["RegisterdPump"]).ToString()).Selected = true;
                }

                //dpIsActive.ClearSelection();
                //if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "True")
                //{
                //    dpIsActive.Items.FindByValue("1").Selected = true;
                //}
                //if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "False")
                //{
                //    dpIsActive.Items.FindByValue("2").Selected = true;
                //}


                //txtBata.Text = string.IsNullOrEmpty((Convert.ToDecimal(DS.Tables[0].Rows[0]["Bata"]).ToString("#.##"))) ? string.Empty : (Convert.ToDecimal(DS.Tables[0].Rows[0]["Bata"]).ToString("#.##"));

                if (DS.Tables[0].Rows[0]["FuelRefielDate"].ToString() == "")
                {
                    txtDate.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FuelRefielDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FuelRefielDate"].ToString();
                }
                else
                {
                    string startdate = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FuelRefielDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FuelRefielDate"].ToString();
                    //sky
                    DateTime date2 = Convert.ToDateTime(startdate, System.Globalization.CultureInfo.GetCultureInfo("ur-PK").DateTimeFormat);
                    txtDate.Text = (Convert.ToDateTime(date2).ToString("yyyy-MM-dd"));
                }

                txtTime.Text = string.IsNullOrEmpty((Convert.ToDateTime(DS.Tables[0].Rows[0]["FuelRefielTime"]).ToString("hh:mm"))) ? string.Empty : (Convert.ToDateTime(DS.Tables[0].Rows[0]["FuelRefielTime"]).ToString("hh:mm"));

                dpUnitType.ClearSelection();
                if (dpUnitType.Items.FindByValue(DS.Tables[0].Rows[0]["UnitType"].ToString()) != null)
                {
                    dpUnitType.Items.FindByValue(DS.Tables[0].Rows[0]["UnitType"].ToString()).Selected = true;
                }
                dpFuelType.ClearSelection();
                if (dpFuelType.Items.FindByValue(DS.Tables[0].Rows[0]["FuelType"].ToString()) != null)
                {
                    dpFuelType.Items.FindByValue(DS.Tables[0].Rows[0]["FuelType"].ToString()).Selected = true;
                }
                txtAmt.Text               = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Amount"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Amount"].ToString();
                txtQty.Text               = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FuelQty"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FuelQty"].ToString();
                txtReceiptNo.Text         = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ReceiptNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ReceiptNo"].ToString();
                txtnonregisteredpump.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Nonregisterpump"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Nonregisterpump"].ToString();
                txtPrice.Text             = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FuelCostprice"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FuelCostprice"].ToString();
            }
        }