示例#1
0
        public void GetINOperationDetailsbyVechileId(int Vehicleid)
        {
            transportdata       = new TransportData();
            DS                  = transportdata.GetINOperationDetailsbyVechileId(Vehicleid);
            lblShowMessage.Text = string.Empty;
            lblOperationId.Text = string.Empty;

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                lblOperationId.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VOp"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VOp"].ToString();
                txtBata.Text        = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Bata"].ToString()) ? string.Empty : (Convert.ToDecimal(DS.Tables[0].Rows[0]["Bata"]).ToString("#.##"));
                txtSalesBata.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SMBata"].ToString()) ? string.Empty : (Convert.ToDecimal(DS.Tables[0].Rows[0]["SMBata"]).ToString("#.##"));

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


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


                dpOperations.ClearSelection();
                if (dpOperations.Items.FindByValue(DS.Tables[0].Rows[0]["OperationType"].ToString()) != null)
                {
                    dpOperations.Items.FindByValue(DS.Tables[0].Rows[0]["OperationType"].ToString()).Selected = true;
                }
                txtStartKm.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["StartKm"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["StartKm"].ToString();
            }
            if (Comman.Comman.IsDataSetEmpty(DS))
            {
                lblShowMessage.Text = "Vehicle is not in  Operation";
            }
        }