Ejemplo n.º 1
0
        public void WcViewInformation(Int64 YournEstelamId)
        {
            try
            {
                var       Lst = R2CoreTransportationAndLoadNotificationMClassLoadPermissionManagement.GetLoadPermissionsIssued(YournEstelamId);
                DataTable dt  = new DataTable();
                dt.Columns.Add(new DataColumn("LoadAllocationId", typeof(string)));
                dt.Columns.Add(new DataColumn("StrDescription", typeof(string)));
                dt.Columns.Add(new DataColumn("IssuedLocation", typeof(string)));
                dt.Columns.Add(new DataColumn("strAddress", typeof(string)));
                dt.Columns.Add(new DataColumn("Mobile", typeof(string)));
                dt.Columns.Add(new DataColumn("StrExitDateTime", typeof(string)));
                dt.Columns.Add(new DataColumn("StrSmartCardNo", typeof(string)));
                dt.Columns.Add(new DataColumn("StrNationalCode", typeof(string)));
                dt.Columns.Add(new DataColumn("StrDrivingLicenceNo", typeof(string)));
                dt.Columns.Add(new DataColumn("TruckDriver", typeof(string)));
                dt.Columns.Add(new DataColumn("TruckSmartCardNo", typeof(string)));
                dt.Columns.Add(new DataColumn("Truck", typeof(string)));

                for (int i = 0; i <= Lst.Count - 1; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["LoadAllocationId"]    = R2CoreTransportationAndLoadNotificationMClassLoadAllocationManagement.GetNSSLoadAllocation(Lst[i].nEstelamId, Lst[i].TurnId).LAId.ToString();
                    dr["StrDescription"]      = Lst[i].StrDescription.Trim();
                    dr["IssuedLocation"]      = Lst[i].IssuedLocation.Trim();
                    dr["strAddress"]          = Lst[i].strAddress.Trim();
                    dr["Mobile"]              = Lst[i].Mobile.Trim();
                    dr["StrExitDateTime"]     = Lst[i].LoadPermissionDate.Trim() + "-" + Lst[i].LoadPermissionTime.Trim();
                    dr["StrSmartcardNo"]      = Lst[i].StrSmartCardNo.Trim();
                    dr["StrNationalCode"]     = Lst[i].StrNationalCode.Trim();
                    dr["StrDrivingLicenceNo"] = Lst[i].StrDrivingLicenceNo.Trim();
                    dr["TruckDriver"]         = Lst[i].TruckDriver.Trim();
                    dr["Truck"]            = Lst[i].Truck.Trim();
                    dr["TruckSmartCardNo"] = Lst[i].TruckSmartCardNo.Trim();
                    dt.Rows.Add(dr);
                }

                GridViewLoadCapacitorLoadLoadPermissionsIssued.DataSource = dt;
                GridViewLoadCapacitorLoadLoadPermissionsIssued.DataBind();
            }
            catch (LoadAllocationNotFoundException ex)
            { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); }
            catch (Exception ex)
            { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "." + ex.Message + "');", true); }
        }
        public void UCViewInformation(Int64 YournEstelamId)
        {
            try
            {
                var       Lst = R2CoreTransportationAndLoadNotificationMClassLoadPermissionManagement.GetLoadPermissionsIssued(YournEstelamId);
                DataTable dt  = new DataTable();
                dt.Columns.Add(new DataColumn("StrDescription", typeof(string)));
                dt.Columns.Add(new DataColumn("IssuedLocation", typeof(string)));
                dt.Columns.Add(new DataColumn("strAddress", typeof(string)));
                dt.Columns.Add(new DataColumn("Mobile", typeof(string)));
                dt.Columns.Add(new DataColumn("StrExitDateTime", typeof(string)));
                dt.Columns.Add(new DataColumn("StrSmartcardNo", typeof(string)));
                dt.Columns.Add(new DataColumn("StrNationalCode", typeof(string)));
                dt.Columns.Add(new DataColumn("StrDrivingLicenceNo", typeof(string)));
                dt.Columns.Add(new DataColumn("TruckDriver", typeof(string)));
                dt.Columns.Add(new DataColumn("Truck", typeof(string)));

                //GridView1.AutoGenerateColumns = false;
                for (int i = 0; i <= Lst.Count - 1; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["StrDescription"]      = Lst[i].StrDescription.Trim();
                    dr["IssuedLocation"]      = Lst[i].IssuedLocation.Trim();
                    dr["strAddress"]          = Lst[i].strAddress.Trim();
                    dr["Mobile"]              = Lst[i].Mobile.Trim();
                    dr["StrExitDateTime"]     = Lst[i].LoadPermissionDate.Trim() + "-" + Lst[i].LoadPermissionTime.Trim();
                    dr["StrSmartcardNo"]      = Lst[i].StrSmartcardNo.Trim();
                    dr["StrNationalCode"]     = Lst[i].StrNationalCode.Trim();
                    dr["StrDrivingLicenceNo"] = Lst[i].StrDrivingLicenceNo.Trim();
                    dr["TruckDriver"]         = Lst[i].TruckDriver.Trim();
                    dr["Truck"] = Lst[i].Truck.Trim();
                    dt.Rows.Add(dr);
                }
                GridViewLoadCapacitorLoadLoadPermissionsIssued.DataSource = dt;
                GridViewLoadCapacitorLoadLoadPermissionsIssued.DataBind();
                GridViewLoadCapacitorLoadLoadPermissionsIssued.Caption = "لیست مجوزهای صادرشده کد مخزن " + YournEstelamId.ToString();
            }
            catch (Exception ex)
            { Response.Write("<script>alert('" + ex.Message + "')</script>"); }
        }