コード例 #1
0
        public ActionResult Create(string id, int?type)
        {
            QueryCRMDriverViewModel vi = new QueryCRMDriverViewModel();

            if (string.IsNullOrEmpty(id))
            {
                CRMDriver v = new CRMDriver();
                v.Str1            = Guid.NewGuid().ToString();
                v.Str2            = Guid.NewGuid().ToString();
                v.Str3            = Guid.NewGuid().ToString();
                v.Str4            = Guid.NewGuid().ToString();
                v.DriverIsServing = true;
                vi.CreateDriver   = v;
                vi.ViewType       = 0;
            }
            else
            {
                if (type == 1)
                {
                    var response = new DriverManagementService().GetSearcheDriver(id);
                    vi.CreateDriver = response;
                    vi.ViewType     = 1;
                }
                else
                {
                    var response = new DriverManagementService().GetSearcheDriver(id);
                    vi.CreateDriver = response;
                    vi.ViewType     = 0;
                }
            }
            return(View(vi));
        }
コード例 #2
0
 public CRMDriverToDb(CRMDriver Driver)
     : base(s_metadata)
 {
     SetSqlInt64(0, Driver.ID);
     SetSqlString(1, Driver.DriverName);
     SetSqlDateTime(2, Driver.DriverBirthday);
     SetSqlString(3, Driver.DriverPhone);
     SetSqlString(4, Driver.DriverLogisticsCompany);
     SetSqlDateTime(5, Driver.DriverStartServeForRunbowDate);
     SetSqlString(6, Driver.DriverIDCard);
     SetSqlString(7, Driver.DriverLogisticsContactPerson);
     SetSqlString(8, Driver.DriverCardNo);
     SetSqlString(9, Driver.DriverLogisticsCompanyContactPhone);
     SetSqlString(10, Driver.DriverCardType);
     SetSqlBoolean(11, Driver.DriverIsServing);
     SetSqlString(12, Driver.DriverRegistrationNo);
     SetSqlString(13, Driver.DriverRegistrationCardSignedAddress);
     SetSqlDateTime(14, Driver.DriverNextYearCheckDate);
     SetSqlDateTime(15, Driver.DriverFirstTimeGetCardDate);
     SetSqlDateTime(16, Driver.DriverNextYearCheckBodyDate);
     SetSqlString(17, Driver.DriverServiceArea);
     SetSqlString(18, Driver.DriverCarNo);
     SetSqlString(19, Driver.DriverMainRoute);
     SetSqlDateTime(20, Driver.CreateTime ?? SqlTypes.SqlDateTime.Null);
     SetSqlString(21, Driver.CreateUser);
     SetSqlDateTime(22, Driver.UpdateTime ?? SqlTypes.SqlDateTime.Null);
     SetSqlString(23, Driver.UpdateUser);
     SetSqlString(24, Driver.Str1);
     SetSqlString(25, Driver.Str2);
     SetSqlString(26, Driver.Str3);
     SetSqlString(27, Driver.Str4);
     SetSqlString(28, Driver.Str5);
     SetSqlString(29, Driver.Str6);
     SetSqlString(30, Driver.Str7);
     SetSqlString(31, Driver.Str8);
     SetSqlString(32, Driver.Str9);
     SetSqlString(33, Driver.Str10);
     SetSqlString(34, Driver.Str11);
     SetSqlString(35, Driver.Str12);
     SetSqlString(36, Driver.Str13);
     SetSqlString(37, Driver.Str14);
     SetSqlString(38, Driver.Str15);
     SetSqlString(39, Driver.Str16);
     SetSqlString(40, Driver.Str17);
     SetSqlString(41, Driver.Str18);
     SetSqlString(42, Driver.Str19);
     SetSqlString(43, Driver.Str20);
     SetSqlDateTime(44, Driver.Datetime1 ?? SqlTypes.SqlDateTime.Null);
     SetSqlDateTime(45, Driver.Datetime2 ?? SqlTypes.SqlDateTime.Null);
     SetSqlDateTime(46, Driver.Datetime3 ?? SqlTypes.SqlDateTime.Null);
     SetSqlDateTime(47, Driver.Datetime4 ?? SqlTypes.SqlDateTime.Null);
     SetSqlDateTime(48, Driver.Datetime5 ?? SqlTypes.SqlDateTime.Null);
     SetSqlBoolean(49, Driver.Bit1);
     SetSqlBoolean(50, Driver.Bit2);
     SetSqlBoolean(51, Driver.Bit3);
 }
コード例 #3
0
        public CRMDriver GetSearcheDriver(string id)
        {
            CRMDriver SearcheFiles = new CRMDriver();

            try
            {
                DriverManagementAccessor accessor = new DriverManagementAccessor();
                SearcheFiles = accessor.GetCRMDriverSearchConditionByID(id);
            }
            catch (Exception)
            {
                throw;
            }
            return(SearcheFiles);
        }
コード例 #4
0
        //车辆司机管理 分页
        public IEnumerable <CRMDriver> GetAllDriver(CRMDriver Driver, string driver, int PageIndex, int PageSize, out int RowCount)
        {
            string Where        = SqlWhere(driver);
            int    tempRowCount = 0;

            DbParam[] dbParams = new DbParam[] {
                new DbParam("@Where", DbType.String, Where, ParameterDirection.Input),
                new DbParam("@PageIndex", DbType.Int32, PageIndex, ParameterDirection.Input),
                new DbParam("@PageSize", DbType.Int32, PageSize, ParameterDirection.Input),
                new DbParam("@RowCount", DbType.Int32, tempRowCount, ParameterDirection.Output)
            };
            DataTable dt = this.ExecuteDataTable("Proc_GetAllDriver", dbParams);

            RowCount = (int)dbParams[3].Value;
            return(dt.ConvertToEntityCollection <CRMDriver>());
        }
コード例 #5
0
        public CRMDriver addCreateDriver(GetCRMDriverByConditionRequest request)
        {
            CRMDriver CreateDriver = new CRMDriver();

            try
            {
                CRMDriver         Driver    = new CRMDriver();
                IList <CRMDriver> CRMDriver = new List <CRMDriver>();
                CRMDriver.Add(request.AddDriver);
                DriverManagementAccessor accessor = new DriverManagementAccessor();
                CreateDriver = accessor.AddOrUpdateCRMDriver(CRMDriver);// request.PageIndex, request.PageSize, out RowCount
            }
            catch (Exception)
            {
                throw;
            }
            return(CreateDriver);
        }