Beispiel #1
0
        private ActionPayload GetPayload()
        {
            var payload = new ActionPayload {
                Api     = api,
                BoxId   = box.BoxId,
                Token   = token,
                Entity  = CurrentItem.Value.Entity,
                Message = CurrentItem.Value.Message
            };

            return(payload);
        }
Beispiel #2
0
 public RequestResolution(ActionPayload payload, ResolutionRequestType type)
     : base(payload)
 {
     IsEnabled.Value = false;
     this.type       = type;
     if (type == ResolutionRequestType.ApprovementRequest)
     {
         Header.Value = "Передача на согласование";
     }
     else
     {
         Header.Value = "Передача на подпись";
     }
 }
 public Resolution(ActionPayload payload, ResolutionType type)
     : base(payload)
 {
     this.type = type;
     if (type == ResolutionType.Approve)
     {
         Header.Value        = "Согласование документа";
         Clarification.Value = "Результат согласования и комментарий будут видны только сотрудникам вашей организации.";
         ActionName.Value    = "Согласовать";
     }
     else
     {
         Header.Value     = "Отказ в согласовании документа";
         ActionName.Value = "Отказать";
     }
 }
Beispiel #4
0
 public Delete(ActionPayload payload)
     : base(payload)
 {
 }
Beispiel #5
0
 public Reject(ActionPayload payload)
     : base(payload)
 {
 }
Beispiel #6
0
 public Revocation(ActionPayload payload)
     : base(payload)
 {
 }
Beispiel #7
0
        public DiadokAction(ActionPayload payload)
        {
            Success = false;
            InitFields();
            Payload = payload;

            switch (payload.Entity.AttachmentType)
            {
            case AttachmentType.XmlTorg12:
                DocumentName = new DiadocXmlHelper(payload.Entity).GetDiadokTORG12Name(" , ");
                break;

            case AttachmentType.Invoice:
                DocumentName = new DiadocXmlHelper(payload.Entity).GetDiadokInvoiceName(" , ");
                break;

            default:
                DocumentName = payload.Entity.FileName;
                break;
            }

            IsEnabled.Value = true;

            if (Settings.Value.DebugUseTestSign)
            {
                SignerFirstName  = "Иван";
                SignerSureName   = "Иванович";
                SignerPatronimic = "Иванов";
                SignerINN        = Settings.Value.DebugDiadokSignerINN;
            }
            else
            {
                Cert = Settings.Value.GetCert(Settings.Value.DiadokCert);
                var certFields = X509Helper.ParseSubject(Cert.Subject);
                try {
                    var namefp = certFields["G"].Split(' ');
                    SignerFirstName  = namefp[0];
                    SignerSureName   = certFields["SN"];
                    SignerPatronimic = namefp[1];
                    if (!String.IsNullOrEmpty(Settings.Value.DebugDiadokSignerINN))
                    {
                        SignerINN = Settings.Value.DebugDiadokSignerINN;
                    }
                    else
                    {
                        if (certFields.Keys.Contains("OID.1.2.643.3.131.1.1"))
                        {
                            SignerINN = certFields["OID.1.2.643.3.131.1.1"];
                        }
                        if (certFields.Keys.Contains("ИНН"))
                        {
                            SignerINN = certFields["ИНН"];
                        }
                        if (String.IsNullOrEmpty(SignerINN))
                        {
                            throw new Exception("Не найдено поле ИНН(OID.1.2.643.3.131.1.1)");
                        }
                    }
                    SignerINN = SignerINN.Substring(2);
                }
                catch (Exception exept) {
                    Log.Error("Ошибка разбора сертификата, G,SN,OID.1.2.643.3.131.1.1", exept);
                }
            }
        }
Beispiel #8
0
 public Sign(ActionPayload payload)
     : base(payload)
 {
     if (ReqRevocationSign)
     {
         OperationName.Value = "Аннулирование документа";
     }
     else
     {
         OperationName.Value = "Подписание Документа";
     }
     Torg12TitleVisible = Payload.Entity.AttachmentType == AttachmentType.XmlTorg12 && !ReqRevocationSign;
     RcvFIO.Value       = $"{SignerSureName} {SignerFirstName} {SignerPatronimic}";
     RcvJobTitle.Value  = Settings.Value.DiadokSignerJobTitle;
     RcvDate.Value      = DateTime.Now;
     LikeReciever.Subscribe(x => {
         if (x)
         {
             AcptFirstName.Value  = SignerFirstName;
             AcptSurename.Value   = SignerSureName;
             AcptPatronimic.Value = SignerPatronimic;
             AcptJobTitle.Value   = RcvJobTitle.Value;
         }
     });
     ByAttorney.Subscribe(x => {
         if (!x)
         {
             AtrNum.Value          = "";
             AtrOrganization.Value = "";
             AtrSurename.Value     = "";
             AtrFirstName.Value    = "";
             AtrPatronymic.Value   = "";
             AtrAddInfo.Value      = "";
         }
     });
     CurrentAutoSave = new NotifyValue <SignTorg12Autosave>();
     CurrentAutoSave.Subscribe(x => {
         if (x != null)
         {
             RcvJobTitle.Value = x.SignerJobTitle;
             if (x.LikeReciever)
             {
                 LikeReciever.Value = true;
             }
             else
             {
                 AcptFirstName.Value  = x.AcptFirstName;
                 AcptSurename.Value   = x.AcptSurename;
                 AcptPatronimic.Value = x.AcptPatronimic;
                 AcptJobTitle.Value   = x.AcptJobTitle;
             }
             if (x.ByAttorney)
             {
                 ByAttorney.Value      = true;
                 AtrNum.Value          = x.AtrNum;
                 AtrDate.Value         = x.AtrDate;
                 AtrOrganization.Value = x.AtrOrganization;
                 AtrJobTitle.Value     = x.AtrJobTitle;
                 AtrSurename.Value     = x.AtrSurename;
                 AtrFirstName.Value    = x.AtrFirstName;
                 AtrPatronymic.Value   = x.AtrPatronymic;
                 AtrAddInfo.Value      = x.AtrAddInfo;
             }
             else
             {
                 ByAttorney.Value      = false;
                 AtrNum.Value          = "";
                 AtrDate.Value         = null;
                 AtrOrganization.Value = "";
                 AtrJobTitle.Value     = "";
                 AtrSurename.Value     = "";
                 AtrFirstName.Value    = "";
                 AtrPatronymic.Value   = "";
                 AtrAddInfo.Value      = "";
             }
             Comment.Value = x.Comment;
         }
     });
     Comment.Subscribe(x => {
         if (!String.IsNullOrEmpty(x))
         {
             CommentVisibility.Value = true;
         }
         else
         {
             CommentVisibility.Value = false;
         }
     });
 }