Exemplo n.º 1
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;
     }
 }
Exemplo n.º 2
0
        public static string SetAgreementData(string sessionId, string methodName, Agreement agr)
        {
            string result = String.Empty;

            string linkedRnk = String.Empty;

            if (agr.LinkedPersons.Count > 0)
            {

                foreach (var person in agr.LinkedPersons)
                {
                    linkedRnk += "{";

                    linkedRnk += String.Format("\"RNK\": {0}, \"LinkPersonStateID\": {1}", person.Rnk,
                        person.PersonState);

                    linkedRnk += "},";
                }

            }

            result += "{";
            result += String.Format("\"sessionid\":\"{0}\",\"method\":\"{1}\",\"params\":" +
                                    "[{{\"agr_code\":\"{2}\",\"RNK\":{3},\"changed\":\"{4}\",\"created\":\"{5}\",\"branch_id\":\"{6}\"," +
                                    "\"user_login\":\"{7}\",\"user_fio\":\"{8}\",\"agr_type\":\"{9}\",\"agr_status\":\"{10}\",\"agr_number\":\"{11}\"," +
                                    "\"agr_date_open\":\"{12}\",\"account_number\":\"{13}\",\"agr_date_close\":\"{14}\",\"linkedRNK\":[{15}]" +
                                    "}}],\"message_id\":\"BARS-MESS-379518\"", sessionId, methodName, agr.AgrCode, agr.Rnk, agr.ChangeDate, agr.CreateDate,
                                    agr.BranchCode, agr.UserLogin, agr.UserFio, agr.AgrTypeCode, agr.AgrStatusCode, agr.AgrNumber, agr.AgrOpenDate,
                                    agr.AccountNumber, agr.AgrCloseDate, linkedRnk);
            //"linkedRNK":[{"RNK":1234307,"LinkPersonStateID":4}]}],"
            result += "}";
            return result;
        }
Exemplo n.º 3
0
        private Agreement GetAgreementItem()
        {
            Agreement agreement = new Agreement();

            agreement.AgrCode = paramsGridView.Rows[0].Cells[1].Value.ToString();
            agreement.Rnk = paramsGridView.Rows[1].Cells[1].Value.ToString();
            agreement.ChangeDate = paramsGridView.Rows[2].Cells[1].Value.ToString();
            agreement.CreateDate = paramsGridView.Rows[3].Cells[1].Value.ToString();
            agreement.BranchCode = paramsGridView.Rows[4].Cells[1].Value.ToString();
            agreement.UserLogin = paramsGridView.Rows[5].Cells[1].Value.ToString();
            agreement.UserFio = paramsGridView.Rows[6].Cells[1].Value.ToString();
            agreement.AgrTypeCode = paramsGridView.Rows[7].Cells[1].Value.ToString();
            agreement.AgrStatusCode = paramsGridView.Rows[8].Cells[1].Value.ToString();
            agreement.AgrNumber = paramsGridView.Rows[9].Cells[1].Value.ToString();
            agreement.AgrOpenDate = paramsGridView.Rows[10].Cells[1].Value.ToString();
            agreement.AccountNumber = paramsGridView.Rows[11].Cells[1].Value.ToString();
            agreement.AgrCloseDate = paramsGridView.Rows[12].Cells[1].Value.ToString();

            for (int i = 13; i < paramsGridView.Rows.Count; i++)
            {
                LinkedPerson lk = new LinkedPerson();
                lk.Rnk = paramsGridView.Rows[i].Cells[1].Value.ToString();

                i++;

                lk.PersonState = paramsGridView.Rows[i].Cells[1].Value.ToString();

                agreement.LinkedPersons.Add(lk);
            }

            _userHistory.CurrentItem = agreement;

            return agreement;
        }