Ejemplo n.º 1
0
        public OpertionResult Create(PartnerActivity partnerActivity)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_act_id", OracleDbType = OracleDbType.Varchar2, Value = partnerActivity.Activity.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_fromroleid", OracleDbType = OracleDbType.Int32, Value = partnerActivity.FromRole.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_queryduration", OracleDbType = OracleDbType.Varchar2, Value = partnerActivity.MaxQueryDuration.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_act_scope", OracleDbType = OracleDbType.Varchar2, Value = partnerActivity.Scope.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_maxrec", OracleDbType = OracleDbType.Int32, Value = partnerActivity.MaxQueryRows
                    },
                    new OracleParameter {
                        ParameterName = "v_onlypartchildren", OracleDbType = OracleDbType.Int32, Value = partnerActivity.OnlyPartnerChildren ? 1 : 0
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = partnerActivity.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = partnerActivity.CreatedBy.Account
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_Settings.fn_CreatePartnerActivity", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 2
0
        public OpertionResult Create(UserNotify obj, bool thenPostIt = false)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_subject", OracleDbType = OracleDbType.NVarchar2, Value = obj.Subject
                    },
                    new OracleParameter {
                        ParameterName = "v_content", OracleDbType = OracleDbType.NVarchar2, Value = obj.Content
                    },
                    new OracleParameter {
                        ParameterName = "v_priority", OracleDbType = OracleDbType.Varchar2, Value = obj.Priority.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyid", OracleDbType = OracleDbType.Varchar2, Value = obj.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_expire_time", OracleDbType = OracleDbType.Date, Value = obj.ExpireOn
                    },
                    new OracleParameter {
                        ParameterName = "v_post_it", OracleDbType = OracleDbType.Int32, Value = thenPostIt ? 1 : 0
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_usersinstruct", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    foreach (var item in obj.NotifyToList)
                    {
                        item.UserNotifyId = result;
                        CreateUserNotifyTo(item);
                    }
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 3
0
        public OpertionResult Create(ActivityMessage msg)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_act_id", OracleDbType = OracleDbType.Varchar2, Value = msg.Activity.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_msg_id", OracleDbType = OracleDbType.Int32, Value = msg.Message.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_sending_time", OracleDbType = OracleDbType.Varchar2, Value = msg.SendingTime.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = msg.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = msg.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_msg_order", OracleDbType = OracleDbType.Int32, Value = msg.MessageOrder
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_settings.fn_create_activity_message", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 4
0
        public bool ChangePwd(int PartnerAcc, string PartnerId, string newPwd, bool notify = true)
        {
            //var pass = Utility.GenerateNewCode(4);
            byte[] salt = Pbkdf2Hasher.GenerateRandomSalt();
            string hash = Pbkdf2Hasher.ComputeHash(newPwd, salt);

            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_acc", OracleDbType = OracleDbType.Int32, Value = PartnerAcc
                    },
                    new OracleParameter {
                        ParameterName = "v_pwd", OracleDbType = OracleDbType.Varchar2, Value = hash
                    },
                    new OracleParameter {
                        ParameterName = "v_extra", OracleDbType = OracleDbType.Varchar2, Value = Convert.ToBase64String(salt)
                    }
                };

                #endregion
                db.ExecuteStoredProc("pk_infra.fn_ChangePassword", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    if (notify)
                    {
                        var msg = "تم تغيير الرقم السري الخاصب بك الى " + newPwd;
                        new OutSMSRepo(db).Create(new SMSOut
                        {
                            Receiver = PartnerId,
                            Message  = msg
                        });
                    }
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        public OpertionResult Create(MessageTemplate template)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_msg_name", OracleDbType = OracleDbType.NVarchar2, Value = template.Title
                    },
                    new OracleParameter {
                        ParameterName = "v_msg_text", OracleDbType = OracleDbType.NVarchar2, Value = template.Message
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = template.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = template.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_towho", OracleDbType = OracleDbType.Int32, Value = template.ToWho
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_settings.fn_create_message_template", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 6
0
        public OpertionResult Create(PaymentValues pValue)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_pvalue", OracleDbType = OracleDbType.Double, Value = pValue.PayValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = pValue.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_created_acc", OracleDbType = OracleDbType.Int32, Value = pValue.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_profile_id", OracleDbType = OracleDbType.Int32, Value = pValue.ProfileId
                    }
                };
                #endregion
                _db.ExecuteStoredProc("pk_infra.fn_create_pay_values", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 7
0
 public OpertionResult Create(DataAudit data)
 {
     try
     {
         #region Parameters
         var parameters = new List <OracleParameter> {
             new OracleParameter {
                 ParameterName = "v_partner_id", OracleDbType = OracleDbType.Varchar2, Value = data.PartnerId
             },
             new OracleParameter {
                 ParameterName = "v_partner_acc", OracleDbType = OracleDbType.Int32, Value = data.PartnerAccount
             },
             new OracleParameter {
                 ParameterName = "v_act_id", OracleDbType = OracleDbType.Varchar2, Value = data.Activity.Id
             },
             new OracleParameter {
                 ParameterName = "v_action_id", OracleDbType = OracleDbType.Varchar2, Value = data.Action.Id
             },
             new OracleParameter {
                 ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = data.Note
             },
             new OracleParameter {
                 ParameterName = "v_old_value", OracleDbType = OracleDbType.NVarchar2, Value = data.OldValue
             },
             new OracleParameter {
                 ParameterName = "v_new_value", OracleDbType = OracleDbType.NVarchar2, Value = data.NewValue
             },
             new OracleParameter {
                 ParameterName = "v_system_note", OracleDbType = OracleDbType.NVarchar2, Value = data.SystemNote
             },
             new OracleParameter {
                 ParameterName = "v_error", OracleDbType = OracleDbType.Varchar2, Value = data.Error
             },
             new OracleParameter {
                 ParameterName = "v_success", OracleDbType = OracleDbType.Int32, Value = data.Success ? 1 : 0
             }
         };
         #endregion
         var result = db.ExecuteStoredProc("pk_utility.sp_create_audit", parameters);
         return(new OpertionResult {
             AffectedCount = result, Success = true, Error = string.Empty
         });
         //if (result > 0)
         //{
         //    return new OpertionResult { AffectedCount = result, Success = true, Error = string.Empty };
         //}
         //else
         //{
         //    return new OpertionResult { AffectedCount = result, Success = false, Error = string.Empty };
         //}
     }
     catch (Exception ex)
     {
         return(new OpertionResult {
             AffectedCount = -1, Success = false, Error = ex.Message
         });
     }
 }
Ejemplo n.º 8
0
        public OpertionResult Create(PartnerStatusLog log)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = log.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = log.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_id", OracleDbType = OracleDbType.Varchar2, Value = log.Partner.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_acc", OracleDbType = OracleDbType.Int32, Value = log.Partner.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_old_status", OracleDbType = OracleDbType.Int32, Value = log.OldStatus.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_new_status", OracleDbType = OracleDbType.Int32, Value = log.NewStatus.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = log.Note
                    },
                    new OracleParameter {
                        ParameterName = "v_newstatus_expireon", OracleDbType = OracleDbType.Date, Value = log.NewStatusExpireOn
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_partnerstatus_log", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 9
0
        public OpertionResult Create(Adjustment adjust)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = adjust.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_moneytranferid", OracleDbType = OracleDbType.Int32, Value = adjust.MoneyTransferId
                    },
                    new OracleParameter {
                        ParameterName = "v_amount", OracleDbType = OracleDbType.Decimal, Value = adjust.Amount
                    },
                    new OracleParameter {
                        ParameterName = "v_access_channel", OracleDbType = OracleDbType.Varchar2, Value = adjust.AccessChannel.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = adjust.Note
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Varchar2, Value = adjust.CreatedBy.Account
                    }
                };

                #endregion
                db.ExecuteStoredProc("pk_financial.fn_create_adjustment", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 10
0
        public OpertionResult Create(ApiIPBlacklist obj)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_ip_address", OracleDbType = OracleDbType.Varchar2, Value = obj.IPAddress
                    }
                };
                #endregion
                _db.ExecuteStoredProc("pk_infra.fn_create_api_ip_blacklist", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 11
0
        public OpertionResult Create(ApiLogFile obj)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_log_data", OracleDbType = OracleDbType.NVarchar2, Value = obj.Data
                    },
                    new OracleParameter {
                        ParameterName = "v_log_user", OracleDbType = OracleDbType.Varchar2, Value = obj.User
                    },
                    new OracleParameter {
                        ParameterName = "v_log_ip", OracleDbType = OracleDbType.Varchar2, Value = obj.Ip
                    },
                    new OracleParameter {
                        ParameterName = "v_log_level", OracleDbType = OracleDbType.Int32, Value = obj.Level
                    },
                    new OracleParameter {
                        ParameterName = "v_log_action", OracleDbType = OracleDbType.Varchar2, Value = obj.Action
                    }
                };
                #endregion
                _db.ExecuteStoredProc("pk_infra.fn_create_api_log", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 12
0
        public OpertionResult Create(SMSIn sms)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_reciever", OracleDbType = OracleDbType.Varchar2, Value = sms.Receiver
                    },
                    new OracleParameter {
                        ParameterName = "v_sender", OracleDbType = OracleDbType.Varchar2, Value = sms.Sender
                    },
                    new OracleParameter {
                        ParameterName = "v_message", OracleDbType = OracleDbType.NVarchar2, Value = sms.Message
                    },
                    new OracleParameter {
                        ParameterName = "v_ref_no", OracleDbType = OracleDbType.Int32, Value = sms.RefNo
                    },
                    new OracleParameter {
                        ParameterName = "v_lang", OracleDbType = OracleDbType.Varchar2, Value = sms.Lang
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_in_sms", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 13
0
        public OpertionResult Create(SMSOne created)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = created.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = created.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_receiver", OracleDbType = OracleDbType.Varchar2, Value = created.Receiver
                    },
                    new OracleParameter {
                        ParameterName = "v_msg", OracleDbType = OracleDbType.NVarchar2, Value = created.Message
                    },
                    new OracleParameter {
                        ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = created.Note
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_smsone", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 14
0
        private OpertionResult GeneratePFR(int account, DateTime startDate, DateTime endDate)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "account", OracleDbType = OracleDbType.Int32, Value = account
                    },
                    new OracleParameter {
                        ParameterName = "startdate", OracleDbType = OracleDbType.Date, Value = startDate
                    },
                    new OracleParameter {
                        ParameterName = "enddate", OracleDbType = OracleDbType.Date, Value = endDate
                    }
                };

                #endregion
                db.ExecuteStoredProc("pk_financial.fn_generate_pfr", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 15
0
        public OpertionResult Read(int id)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_his_id", OracleDbType = OracleDbType.Int32, Value = id
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_read_userinstructhis", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 16
0
        public OpertionResult Create(PartnerRequest req)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_req_id", OracleDbType = OracleDbType.Int32, Value = req.RequestId
                    },
                    new OracleParameter {
                        ParameterName = "v_req_content", OracleDbType = OracleDbType.Varchar2, Value = req.Content
                    },
                    new OracleParameter {
                        ParameterName = "v_replay_time", OracleDbType = OracleDbType.Date, Value = req.ReplayTime
                    },
                    new OracleParameter {
                        ParameterName = "v_replay_desc", OracleDbType = OracleDbType.Varchar2, Value = req.ReplayDesc
                    },
                    new OracleParameter {
                        ParameterName = "v_replay_shortcode", OracleDbType = OracleDbType.Varchar2, Value = req.Shortcode
                    },
                    new OracleParameter {
                        ParameterName = "v_status", OracleDbType = OracleDbType.Int32, Value = req.Status
                    },
                    new OracleParameter {
                        ParameterName = "v_queue_no", OracleDbType = OracleDbType.Int32, Value = req.QueueNo
                    },
                    new OracleParameter {
                        ParameterName = "v_error", OracleDbType = OracleDbType.Varchar2, Value = req.Error
                    },
                    new OracleParameter {
                        ParameterName = "v_accesschannel", OracleDbType = OracleDbType.Varchar2, Value = req.AccessChannel
                    },
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_partner_request", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 17
0
        public OpertionResult Create(RechargeCollection rechargeCollection)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_subs_no", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.SubscriberNo
                    },
                    new OracleParameter {
                        ParameterName = "v_amount", OracleDbType = OracleDbType.Decimal, Value = rechargeCollection.Amount
                    },
                    new OracleParameter {
                        ParameterName = "v_pos_id", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.PointOfSale.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_access_channel", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.AccessChannel.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_queue_no", OracleDbType = OracleDbType.Int32, Value = rechargeCollection.QueueNo
                    },
                    new OracleParameter {
                        ParameterName = "v_ref_no", OracleDbType = OracleDbType.Int32, Value = rechargeCollection.RefNo
                    },
                    new OracleParameter {
                        ParameterName = "v_ref_message", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.RefMessage
                    },
                    new OracleParameter {
                        ParameterName = "v_ref_time", OracleDbType = OracleDbType.Date, Value = rechargeCollection.RefTime
                    },
                    new OracleParameter {
                        ParameterName = "v_ref_trans_no", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.RefTransNo
                    },
                    new OracleParameter {
                        ParameterName = "v_debug_info", OracleDbType = OracleDbType.Varchar2, Value = rechargeCollection.DebugInfo
                    },
                    new OracleParameter {
                        ParameterName = "v_status", OracleDbType = OracleDbType.Int32, Value = rechargeCollection.Status.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_api_trans", OracleDbType = OracleDbType.Int64, Value = rechargeCollection.ApiTransaction
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_financial.fn_create_collection", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 18
0
        public OpertionResult Create(AppBackgroundService obj)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = obj.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = obj.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_bg_source", OracleDbType = OracleDbType.Varchar2, Value = obj.Source.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_id", OracleDbType = OracleDbType.Varchar2, Value = obj.Partner.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_acc", OracleDbType = OracleDbType.Int32, Value = obj.Partner.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_start_date", OracleDbType = OracleDbType.Date, Value = obj.StartDate
                    },
                    new OracleParameter {
                        ParameterName = "v_end_date", OracleDbType = OracleDbType.Date, Value = obj.EndDate
                    },
                    new OracleParameter {
                        ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = obj.Note
                    },
                    new OracleParameter {
                        ParameterName = "v_active_time", OracleDbType = OracleDbType.Date, Value = obj.ActiveTime
                    },
                    new OracleParameter {
                        ParameterName = "v_service_name", OracleDbType = OracleDbType.NVarchar2, Value = obj.Name
                    },
                    new OracleParameter {
                        ParameterName = "v_action_partner_id", OracleDbType = OracleDbType.Varchar2, Value = obj.ActionPartner.Id
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_infra.fn_create_bgservice", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 19
0
        public OpertionResult Create(MoneyTransfer transfer)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_part_id", OracleDbType = OracleDbType.Varchar2, Value = transfer.Partner.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_pay_type", OracleDbType = OracleDbType.Varchar2, Value = transfer.PayType.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_pay_no", OracleDbType = OracleDbType.NVarchar2, Value = transfer.PayNo
                    },
                    new OracleParameter {
                        ParameterName = "v_pay_date", OracleDbType = OracleDbType.Date, Value = transfer.PayDate
                    },
                    new OracleParameter {
                        ParameterName = "v_bank_name", OracleDbType = OracleDbType.NVarchar2, Value = transfer.PayBank
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = transfer.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_access_channel", OracleDbType = OracleDbType.Varchar2, Value = transfer.AccessChannel.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_amount", OracleDbType = OracleDbType.Decimal, Value = transfer.Amount
                    },
                    new OracleParameter {
                        ParameterName = "v_bill_no", OracleDbType = OracleDbType.Varchar2, Value = transfer.BillNo
                    },
                    new OracleParameter {
                        ParameterName = "v_request_no", OracleDbType = OracleDbType.Varchar2, Value = transfer.RequestNo
                    },
                    new OracleParameter {
                        ParameterName = "v_request_amt", OracleDbType = OracleDbType.Decimal, Value = transfer.RequestAmount
                    },
                    new OracleParameter {
                        ParameterName = "v_note", OracleDbType = OracleDbType.NVarchar2, Value = transfer.Note
                    },
                    new OracleParameter {
                        ParameterName = "v_api_trans", OracleDbType = OracleDbType.Int64, Value = transfer.ApiTransaction
                    }
                };
                #endregion
                db.ExecuteStoredProc("pk_financial.fn_MoneyTransfer", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }
Ejemplo n.º 20
0
        public OpertionResult Create(ChangeSecretHistory created)
        {
            try
            {
                #region Parameters
                var parameters = new List <OracleParameter> {
                    new OracleParameter {
                        ParameterName = "retVal", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.ReturnValue
                    },
                    new OracleParameter {
                        ParameterName = "v_createdby", OracleDbType = OracleDbType.Varchar2, Value = created.CreatedBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_createdbyacc", OracleDbType = OracleDbType.Int32, Value = created.CreatedBy.Account
                    },
                    new OracleParameter {
                        ParameterName = "v_access_channel", OracleDbType = OracleDbType.Varchar2, Value = created.AccessChannel.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_old_sec_salt", OracleDbType = OracleDbType.Varchar2, Value = created.OldSalt
                    },
                    new OracleParameter {
                        ParameterName = "v_old_hash", OracleDbType = OracleDbType.Varchar2, Value = created.OldHash
                    },
                    new OracleParameter {
                        ParameterName = "v_new_salt", OracleDbType = OracleDbType.Varchar2, Value = created.NewSalt
                    },
                    new OracleParameter {
                        ParameterName = "v_new_hash", OracleDbType = OracleDbType.Varchar2, Value = created.NewHash
                    },
                    new OracleParameter {
                        ParameterName = "v_chg_type", OracleDbType = OracleDbType.Varchar2, Value = created.ChangeType.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_notify_by", OracleDbType = OracleDbType.Varchar2, Value = created.NotifyBy.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_id", OracleDbType = OracleDbType.Varchar2, Value = created.PartAppUser.Id
                    },
                    new OracleParameter {
                        ParameterName = "v_partner_acc", OracleDbType = OracleDbType.Int32, Value = created.PartAppUser.Account
                    }
                };
                #endregion
                _db.ExecuteStoredProc("pk_infra.fn_Create_chgSec_his", parameters);
                var result = int.Parse(parameters.Find(x => x.ParameterName == "retVal").Value.ToString());

                if (result > 0)
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = true, Error = string.Empty
                    });
                }
                else
                {
                    return(new OpertionResult {
                        AffectedCount = result, Success = false, Error = string.Empty
                    });
                }
            }
            catch (Exception ex)
            {
                return(new OpertionResult {
                    AffectedCount = -1, Success = false, Error = ex.Message
                });
            }
        }