Ejemplo n.º 1
0
 public BankData GetData(double loid)
 {
     BankData data = new BankData();
     if (DALObj.GetDataByLOID(loid, null))
     {
         data.LOID = DALObj.LOID;
         data.CODE = DALObj.CODE;
         data.NAME = DALObj.NAME;
     }
     return data;
 }
Ejemplo n.º 2
0
        public bool UpdateData(string userID, BankData data)
        {
            bool ret = true;
            if (VeridateData(data))
            {

                OracleDBObj obj = new OracleDBObj();
                obj.CreateConnection();
                obj.CreateTransaction();
                try
                {
                    DALObj.GetDataByLOID(data.LOID, obj.zTrans);
                    DALObj.CODE = data.CODE.Trim();
                    DALObj.NAME = data.NAME.Trim();
                    DALObj.ACTIVE = Constz.ActiveStatus.Active;

                    if (DALObj.OnDB)
                        ret = DALObj.UpdateCurrentData(userID, obj.zTrans);
                    else
                        ret = DALObj.InsertCurrentData(userID, obj.zTrans);

                    _LOID = DALObj.LOID;

                    if (ret)
                    {
                        obj.zTrans.Commit();
                        obj.CloseConnection();
                    }
                    else
                    {
                        _error = DALObj.ErrorMessage;
                    }
                }
                catch (Exception ex)
                {
                    obj.zTrans.Rollback();
                    obj.CloseConnection();
                    ret = false;
                    throw new ApplicationException(ex.Message);
                }
            }
            else
                ret = false;
            return ret;
        }
Ejemplo n.º 3
0
        private bool VeridateData(BankData data)
        {
            bool ret = true;
            if (data.NAME.Trim() == "")
            {
                _error = "¡ÃسÒÃкت×è͸¹Ò¤ÒÃ";
                ret = false;
            }

            else if (DALObj.CheckName(data.LOID, data.NAME.Trim()) == false)
            {
                _error = "ª×è͸¹Ò¤ÒùÕéÁÕÍÂÙèáÅéÇ";
                ret = false;
            }
            return ret;
        }