public void SaveTransaction(TaskCard taskCard, int id)
 {
     stpCancellation = new FinancialPlanner.Common.JSONSerialization().DeserializeFromString <STPCancellation>(taskCard.TaskTransactionType.ToString());
     DataBase.DBService.ExecuteCommandString(string.Format(INSERT_STPCancellation,
                                                           id,
                                                           stpCancellation.Arn,
                                                           stpCancellation.Cid,
                                                           stpCancellation.MemberName,
                                                           stpCancellation.Amc,
                                                           stpCancellation.FolioNumber,
                                                           stpCancellation.Scheme,
                                                           stpCancellation.Options,
                                                           stpCancellation.FromSchemeId,
                                                           stpCancellation.FromOptions,
                                                           stpCancellation.Amount,
                                                           stpCancellation.StpDate,
                                                           stpCancellation.TransactionDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                           stpCancellation.ModeOfExecution,
                                                           stpCancellation.Remark), true);
 }
        private STPCancellation convertToSTPCancellation(DataRow dr)
        {
            STPCancellation STPCancellation = new STPCancellation();

            STPCancellation.Id              = dr.Field <int>("ID");
            STPCancellation.TaskId          = dr.Field <int>("TaskId");
            STPCancellation.Arn             = dr.Field <int>("ARN");
            STPCancellation.Cid             = dr.Field <int>("CID");
            STPCancellation.MemberName      = dr.Field <string>("MemberName");
            STPCancellation.Amc             = dr.Field <int>("AMC");
            STPCancellation.FolioNumber     = dr.Field <string>("FolioNumber");
            STPCancellation.Scheme          = dr.Field <int>("ToSchemeId");
            STPCancellation.Options         = dr.Field <string>("ToOption");
            STPCancellation.FromSchemeId    = dr.Field <int>("FromSchemeId");
            STPCancellation.FromOptions     = dr.Field <string>("FromOption");
            STPCancellation.Amount          = dr.Field <long>("Amount");
            STPCancellation.StpDate         = dr.Field <int>("STPDate");
            STPCancellation.TransactionDate = dr.Field <DateTime>("TransactionDate");
            STPCancellation.ModeOfExecution = dr.Field <string>("ModeOfExecution");
            STPCancellation.Remark          = dr.Field <string>("Remark");
            return(STPCancellation);
        }
        public object GetTransaction(int id)
        {
            try
            {
                Logger.LogInfo("Get: STPCancellation transaction process start");
                STPCancellation STPCancellation = new STPCancellation();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_BY_ID, id));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    STPCancellation = convertToSTPCancellation(dr);
                }
                Logger.LogInfo("Get: STPCancellation purchase transaction process completed.");
                return(STPCancellation);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }