예제 #1
0
        public static bool CheckInItem(ISiteSetting siteSetting, IItem item, IConnectorExplorer connector)
        {
            CheckInForm checkInForm = new CheckInForm();

            checkInForm.Initialize(siteSetting, item);
            if (checkInForm.ShowDialog(null, Languages.Translate("Check In Item")) == true)
            {
                string          comment        = checkInForm.Comments;
                CheckinTypes    checkinType    = checkInForm.CheckInType;
                IServiceManager serviceManager = ServiceManagerFactory.GetServiceManager(siteSetting.SiteSettingType);
                Result          result;
                if (result = serviceManager.CheckInFile(siteSetting, item, comment, checkinType))
                {
                    if (checkInForm.KeepDocumentCheckedOut == true)
                    {
                        serviceManager.CheckOutFile(siteSetting, item);
                    }
                    else
                    {
                        if (connector != null)
                        {
                            item.Properties["ows__Level"] = "1";
                            //connector.ContentExplorer.UpdateItem(item.GetID(), item);
                        }
                    }
                }
                else
                {
                    MessageBox.Show(result.detailResult, result.messageResult, MessageBoxButton.OK, MessageBoxImage.Error);
                    return(false);
                }
            }
            return(true);
        }
예제 #2
0
        private bool DoCheckIn(IEnumerable <IResource> resources)
        {
            if (!CanUseSourceControl)
            {
                return(false);
            }

            using (var dialog = new CheckInForm(SourceControlService, resources))
            {
                dialog.Icon = m_mainForm.Icon;
                dialog.ShowDialog(m_mainForm);
            }

            return(true);
        }
예제 #3
0
파일: MenuItems.cs 프로젝트: chrfin/fdTFS
        /// <summary>
        /// Handles the Clicked event of the checkIn control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by CFI, 2011-01-07</remarks>
        public void checkIn_Clicked(object sender, EventArgs e)
        {
            CheckInForm checkIn = new CheckInForm(Manager, GetPaths());

            if (checkIn.ShowDialog() == DialogResult.OK)
            {
                foreach (ITabbedDocument document in PluginBase.MainForm.Documents)
                {
                    if (checkIn.CheckedInChanges.FirstOrDefault(c => c.LocalItem == document.FileName) != null)
                    {
                        document.Reload(false);
                    }
                }
            }
        }
예제 #4
0
        public ResponseModel <ContractViewModel> SaveCheckInForm(ContractViewModel _model, string imagePath, string signPath)
        {
            ResponseModel <ContractViewModel> response = new ResponseModel <ContractViewModel> {
                Data = new ContractViewModel()
            };

            try
            {
                var model = acmContext.CheckInForm.Where(e => e.Id == _model.CheckInModel.Id).FirstOrDefault();
                if (model != null)
                {
                    model.Id = _model.CheckInModel.Id;
                    model.SummeryOfTaskCompleted = _model.CheckInModel.SummeryOfTaskCompleted;
                    model.EmailAddress           = _model.CheckInModel.EmailAddress;
                    model.Name                  = _model.CheckInModel.Name;
                    model.Vin                   = _model.CheckInModel.Vin;
                    model.Year                  = _model.CheckInModel.Year;
                    model.PartsNeeded           = _model.CheckInModel.PartsNeeded;
                    model.PersonalItemInVehicle = _model.CheckInModel.PersonalItemInVehicle;
                    model.PhoneNumber           = _model.CheckInModel.PhoneNumber;
                    model.CustomerPartSupplied  = _model.CheckInModel.CustomerPartSupplied;
                    model.OdoMeter              = _model.CheckInModel.OdoMeter;
                    model.Models                = _model.CheckInModel.Models;
                    model.Make                  = _model.CheckInModel.Make;
                    model.CreatedOn             = DateTime.Now;
                    model.IsActive              = true;
                    model.IsCheckOut            = false;
                    model.StoreId               = _model.CheckInModel.StoreId;
                    acmContext.SaveChanges();
                    if (!string.IsNullOrEmpty(_model.ProfileModel.Signature))
                    {
                        _model.ProfileModel.CheckInId = model.Id;
                        var signResponse = profileManager.UpdateProfileDetail(_model.ProfileModel, imagePath, signPath);
                        if (signResponse.Status)
                        {
                            response.Data.ProfileModel = signResponse.Data;
                        }
                    }
                    // response.Data = list;
                    response.Data.CheckInModel = _model.CheckInModel;
                    response.Data    = _model;
                    response.Message = "Record updated successfully";
                    response.Status  = true;
                }
                else
                {
                    CheckInForm modelCheckInForm = new CheckInForm();
                    modelCheckInForm.SummeryOfTaskCompleted = _model.CheckInModel.SummeryOfTaskCompleted;
                    modelCheckInForm.EmailAddress           = _model.CheckInModel.EmailAddress;
                    modelCheckInForm.Name                  = _model.CheckInModel.Name;
                    modelCheckInForm.Vin                   = _model.CheckInModel.Vin;
                    modelCheckInForm.Year                  = _model.CheckInModel.Year;
                    modelCheckInForm.PartsNeeded           = _model.CheckInModel.PartsNeeded;
                    modelCheckInForm.PersonalItemInVehicle = _model.CheckInModel.PersonalItemInVehicle;
                    modelCheckInForm.PhoneNumber           = _model.CheckInModel.PhoneNumber;
                    modelCheckInForm.OdoMeter              = _model.CheckInModel.OdoMeter;
                    modelCheckInForm.Models                = _model.CheckInModel.Models;
                    modelCheckInForm.Make                  = _model.CheckInModel.Make;
                    modelCheckInForm.CustomerPartSupplied  = _model.CheckInModel.CustomerPartSupplied;
                    modelCheckInForm.CreatedOn             = DateTime.Now;
                    modelCheckInForm.IsActive              = true;
                    modelCheckInForm.StoreId               = _model.CheckInModel.StoreId;
                    modelCheckInForm.IsCheckOut            = false;
                    acmContext.Add(modelCheckInForm);
                    acmContext.SaveChanges();

                    if (!string.IsNullOrEmpty(_model.ProfileModel.Signature))
                    {
                        _model.ProfileModel.CheckInId = modelCheckInForm.Id;
                        var signResponse = profileManager.AddProfileDetail(_model.ProfileModel, imagePath, signPath);
                        if (signResponse.Status)
                        {
                            response.Data.ProfileModel = signResponse.Data;
                        }
                    }

                    _model.CheckInModel.Id      = modelCheckInForm.Id;
                    _model.CheckInModel.StoreId = modelCheckInForm.StoreId;
                    response.Data.CheckInModel  = _model.CheckInModel;


                    // response.Data = _model;
                    response.Message = "Record saved successfully";
                    response.Status  = true;
                }
            }
            catch (Exception ex)
            {
                response.Data    = null;
                response.Status  = false;
                response.Message = ex.Message;
            }

            return(response);
            // return responseModel;
        }