示例#1
0
        public ActionResult Installation()
        {
            var model = new InstallationListModel();

            model.InstallationLocation   = GetInstallationLocationDropDown();
            model.InstallationProgram    = GetInstallationProgramDropDown();
            model.SendSystemRequirements = GetSendSystemReqDropDown();
            model.SystemType             = GetSystemTypeDropDown();
            HttpSessionStateBase session = HttpContext.Session;

            return(View(model));
        }
示例#2
0
        public ActionResult SubmitInstallation(InstallationListModel model)
        {
            HttpSessionStateBase session = HttpContext.Session;

            try
            {
                Tbl_Installation tu = new Tbl_Installation();
                tu.AdministratorPassword = model.AdministratorPassword;
                tu.ClientsNumber         = model.ClientsNumber;
                tu.CPU = model.CPU;
                tu.CustomerConnector     = model.CustomerConnector;
                tu.Customer_ID           = model.Customer_ID;
                tu.DeliveryDate_Customer = model.DeliveryDate_Customer;
                tu.DeliveryDate_SOHA     = model.DeliveryDate_SOHA;
                tu.Description           = model.Description;
                tu.InstallationLocation  = model.InstallationLocation_ID;
                tu.InstallationProgram   = model.InstallationProgram_ID;
                tu.Installation_ID       = model.Installation_ID;
                tu.IPServer = model.IPServer;
                tu.PurchasedDevicesNumber = model.PurchasedDevicesNumber;
                tu.RAM = model.RAM;
                tu.SendSystemRequirements = model.SendSystemRequirements_ID;
                tu.SystemType             = model.SystemType_ID;
                tu.LastUpdateUser_ID      = Convert.ToInt32(session["UserID"]);
                tu.LastUpdateDate         = DateTime.Now.ToString("yyyy-MM-dd");
                tu.LastUpdateTime         = DateTime.Now.ToString("HH:mm");

                if (_supportService.AddNewInstallation(tu))
                {
                    var gridModel = new DataSourceResult
                    {
                        ExtraData = new InstallationModel
                        {
                            Message      = Message.OperationSuccessful,
                            MessageColor = "green"
                        },
                        Total = 1
                    };
                    return(Json(gridModel));
                }
                else
                {
                    var gridModel = new DataSourceResult
                    {
                        ExtraData = new InstallationModel
                        {
                            Message      = Message.OperationUnsuccessful,
                            MessageColor = "red"
                        },
                        Total = 1
                    };
                    return(Json(gridModel));
                }
            }
            catch (Exception ex)
            {
                var gridModel = new DataSourceResult
                {
                    ExtraData = new InstallationModel
                    {
                        Message      = Message.OperationUnsuccessful,
                        MessageColor = "red"
                    },
                    Total = 1
                };
                return(Json(gridModel));
            }
            //return "";
        }
示例#3
0
        public virtual ActionResult InstallationList(DataSourceRequest command, InstallationListModel model)
        {
            if (string.IsNullOrEmpty(model.AdministratorPassword) && string.IsNullOrEmpty(model.CPU) && string.IsNullOrEmpty(model.CustomerConnector) && string.IsNullOrEmpty(model.DeliveryDate_Customer) && string.IsNullOrEmpty(model.DeliveryDate_SOHA) && string.IsNullOrEmpty(model.Description) && string.IsNullOrEmpty(model.IPServer) && string.IsNullOrEmpty(model.PurchasedDevicesNumber) && string.IsNullOrEmpty(model.RAM) && model.ClientsNumber == 0 && model.Customer_ID == 0 && model.InstallationLocation_ID == 0 && model.InstallationProgram_ID == 0 && model.Installation_ID == 0 && model.SendSystemRequirements_ID == 0 && model.SystemType_ID == 0)
            {
                var Items     = _supportService.GetAllInstallation();
                var gridModel = new DataSourceResult
                {
                    Data = Items.Select(x => new InstallationModel
                    {
                        AdministratorPassword = x.AdministratorPassword,
                        ClientsNumber         = x.ClientsNumber,
                        CPU = x.CPU,
                        CustomerConnector       = x.CustomerConnector,
                        CustomerName            = _customerService.GetCustomerById(x.Customer_ID).CustomerName,
                        Customer_ID             = x.Customer_ID,
                        DeliveryDate_Customer   = x.DeliveryDate_Customer,
                        DeliveryDate_SOHA       = x.DeliveryDate_SOHA,
                        Description             = x.Description,
                        InstallationLocation    = GetInstallationLocationLiteral(x.InstallationLocation),
                        InstallationLocation_ID = x.InstallationLocation,
                        InstallationProgram     = GetInstallationProgramLiteral(x.InstallationProgram),
                        InstallationProgram_ID  = x.InstallationProgram,
                        Installation_ID         = x.Installation_ID,
                        IPServer = x.IPServer,
                        PurchasedDevicesNumber = x.PurchasedDevicesNumber,
                        RAM = x.RAM,
                        SendSystemRequirements    = GetSendSysReqLiteral(x.SendSystemRequirements),
                        SendSystemRequirements_ID = x.SendSystemRequirements,
                        SystemType    = GetSystemTypeLiteral(x.SystemType),
                        SystemType_ID = x.SystemType
                    }),
                    Total = Items.Count()
                };

                return(Json(gridModel));
            }
            else
            {
                var UserItems = _supportService.SearchInstallation(model.CustomerConnector, model.SendSystemRequirements_ID, model.InstallationLocation_ID, model.InstallationProgram_ID, model.SystemType_ID, model.DeliveryDate_SOHA, model.DeliveryDate_Customer, model.ClientsNumber, model.PurchasedDevicesNumber, model.CPU, model.RAM, model.IPServer, model.AdministratorPassword, model.Description);
                var gridModel = new DataSourceResult
                {
                    Data = UserItems.Select(x => new InstallationModel
                    {
                        AdministratorPassword = x.AdministratorPassword,
                        ClientsNumber         = x.ClientsNumber,
                        CPU = x.CPU,
                        CustomerConnector       = x.CustomerConnector,
                        CustomerName            = _customerService.GetCustomerById(x.Customer_ID).CustomerName,
                        Customer_ID             = x.Customer_ID,
                        DeliveryDate_Customer   = x.DeliveryDate_Customer,
                        DeliveryDate_SOHA       = x.DeliveryDate_SOHA,
                        Description             = x.Description,
                        InstallationLocation    = GetInstallationLocationLiteral(x.InstallationLocation),
                        InstallationLocation_ID = x.InstallationLocation,
                        InstallationProgram     = GetInstallationProgramLiteral(x.InstallationProgram),
                        InstallationProgram_ID  = x.InstallationProgram,
                        Installation_ID         = x.Installation_ID,
                        IPServer = x.IPServer,
                        PurchasedDevicesNumber = x.PurchasedDevicesNumber,
                        RAM = x.RAM,
                        SendSystemRequirements    = GetSendSysReqLiteral(x.SendSystemRequirements),
                        SendSystemRequirements_ID = x.SendSystemRequirements,
                        SystemType    = GetSystemTypeLiteral(x.SystemType),
                        SystemType_ID = x.SystemType
                    }),
                    Total = UserItems.Count()
                };

                return(Json(gridModel));
            }
        }