public static string SetAccountData(string sessionId, string methodName, Account account)
 {
     string result = String.Empty;
     result += "{";
     result += String.Format("\"sessionid\":\"{0}\",\"method\":\"{1}\",\"params\":" +
                             "[{{\"RNK\":{2},\"changed\":\"{3}\",\"created\":\"{4}\",\"user_login\":\"{5}\",\"user_fio\":\"{6}\"," +
                             "\"account_number\":\"{7}\",\"currency_code\":\"{8}\",\"mfo\":{9},\"branch_id\":\"{10}\",\"open_date\":\"{11}\"," +
                             "\"close_date\":\"{12}\",\"agr_number\":\"{13}\",\"agr_code\":\"{14}\",\"account_type\":\"{15}\",\"account_status\":{16}}}]," +
                             "\"message_id\":\"BARS-MESS-379518\"", sessionId, methodName, account.Rnk, account.ChangeDate,
                             account.CreateDate, account.UserLogin, account.UserFio, account.AccountNumber, account.CurrencyCode,
                             account.Mfo, account.BranchCode, account.OpenDate, account.CloseDate, account.AgrNumber, account.AgrCode,
                             account.AccountTypeCode, account.AccountStatusCode);
     result += "}";
     return result;
 }
Example #2
0
 private void InitializeEntityForMethod(Methods methodName)
 {
     switch (methodName)
     {
         case Methods.SetDocumentDataWithOutBinary:
             Document doc = new Document(_setParam.UserLoginOther, _setParam.UserNameOther, _setParam.BranchCode, _setParam.ChangeDate, _setParam.CreateDate);
             BuildParamsTable(doc);
             paramsGridView.Rows.RemoveAt(11);
             break;
         case Methods.SetDocumentDataWithBinary:
             Document document = new Document(_setParam.UserLoginOther, _setParam.UserNameOther, _setParam.BranchCode, _setParam.ChangeDate, _setParam.CreateDate);
             BuildParamsTable(document);
             break;
         case Methods.SetClientData:
             Client client = new Client(_setParam.BranchCode, _setParam.ChangeDate, _setParam.CreateDate, _setParam.ClientType, _setParam.BirthDate,
                 _setParam.UserLoginOther, _setParam.UserNameOther);
             BuildParamsTable(client);
             break;
         case Methods.ActualizeIdDocs:
             ActuaalizeDoc actualizeDoc = new ActuaalizeDoc(_setParam.BranchCode, _setParam.UserLoginOther, _setParam.UserNameOther, _setParam.CreateDate);
             BuildParamsTable(actualizeDoc);
             break;
         case Methods.SetAgreementData:
             Agreement agreement = new Agreement(_setParam.ChangeDate, _setParam.CreateDate, _setParam.BranchCode,
                 _setParam.UserLoginOther, _setParam.UserNameOther, _setParam.AgreementType, _setParam.AgreementStatus, _setParam.AgreementOpenDate, new List<LinkedPerson>());
             BuildParamsTable(agreement);
             break;
         case Methods.GetDocumentData:
             DocumentBinary documentBinary = new DocumentBinary();
             BuildParamsTable(documentBinary);
             break;
         case Methods.SetAccountDataU:
             Account account = new Account(_setParam.ChangeDate, _setParam.CreateDate, _setParam.AccountOpenDate, _setParam.UserBranchCodeOther,
                 _setParam.UserLoginOther, _setParam.UserNameOther, _setParam.AccountTypeCode, _setParam.CurrencyCode, _setParam.AccountStatusCode);
             BuildParamsTable(account);
             break;
         case Methods.SetClientDataU:
             CorpClient corpClient = new CorpClient(_setParam.UserBranchCodeOther, _setParam.ChangeDate, _setParam.CreateDate, _setParam.ClientType,
                 _setParam.UserLoginOther, _setParam.UserNameOther, new List<LinkedPerson>() , new List<NoClient>());
             BuildParamsTable(corpClient);
             break;
         case Methods.SetAgreementDataU:
             CorpAgreement corpAgreement = new CorpAgreement(_setParam.ChangeDate, _setParam.CreateDate, _setParam.BranchCode, _setParam.UserLoginOther,
                 _setParam.UserNameOther, _setParam.AgreementType, _setParam.AgreementStatus, _setParam.ClientType, _setParam.AgreementOpenDate);
             BuildParamsTable(corpAgreement);
             break;
         case Methods.SetDictionaryData:
             Branch branch = new Branch();
             BuildParamsTable(branch);
             break;
         case Methods.GetClientDataSed:
             BuildParamsTable(new ClientDataSed());
             break;
         case Methods.GetDocumentMetaDataSed:
             BuildParamsTable(new DocumentMetadataSed());
             break;
         case Methods.GetDictionaryDataSed:
             BuildParamsTable(new DictionaryDataSed());
             break;
         case Methods.SetDocumentAttributesSed:
             var documentAttributeSed = new DocumentAttributeSed();//{ModifyDateTime = _setParam.ChangeDate};
             IFormatProvider theCultureInfo = CultureInfo.InvariantCulture;
             documentAttributeSed.ModifyDateTime = _setParam.ChangeDate.ToString(theCultureInfo);
             BuildParamsTable(documentAttributeSed);
             break;
     }
 }
Example #3
0
        private Account GetAccountItem()
        {
            Account account = new Account
            {
                Rnk = paramsGridView.Rows[0].Cells[1].Value.ToString(),
                ChangeDate = paramsGridView.Rows[1].Cells[1].Value.ToString(),
                CreateDate = paramsGridView.Rows[2].Cells[1].Value.ToString(),
                UserLogin = paramsGridView.Rows[3].Cells[1].Value.ToString(),
                UserFio = paramsGridView.Rows[4].Cells[1].Value.ToString(),
                AccountNumber = paramsGridView.Rows[5].Cells[1].Value.ToString(),
                CurrencyCode = paramsGridView.Rows[6].Cells[1].Value.ToString(),
                Mfo = paramsGridView.Rows[7].Cells[1].Value.ToString(),
                BranchCode = paramsGridView.Rows[8].Cells[1].Value.ToString(),
                OpenDate = paramsGridView.Rows[9].Cells[1].Value.ToString(),
                CloseDate = paramsGridView.Rows[10].Cells[1].Value.ToString(),
                AgrNumber = paramsGridView.Rows[11].Cells[1].Value.ToString(),
                AgrCode = paramsGridView.Rows[12].Cells[1].Value.ToString(),
                AccountTypeCode = paramsGridView.Rows[13].Cells[1].Value.ToString(),
                AccountStatusCode = paramsGridView.Rows[14].Cells[1].Value.ToString()
            };

            _userHistory.CurrentItem = account;

            return account;
        }