Ejemplo n.º 1
0
 public CustomerTypeSearchData GetData(double loid)
 {
     CustomerTypeSearchData data = new CustomerTypeSearchData();
     if (DALObj.GetDataByLOID(loid, null))
     {
         data.ACTIVE = DALObj.ACTIVE;
         data.CODE = DALObj.CODE;
         data.LOID = DALObj.LOID;
         data.NAME = DALObj.NAME;
         data.DISCOUNT = DALObj.DISCOUNT;
         data.LOWERPRICE = DALObj.LOWERPRICE;
         data.DESCRIPTION = DALObj.DESCRIPTION;
     }
     return data;
 }
Ejemplo n.º 2
0
 private bool VeridateData(CustomerTypeSearchData data)
 {
     bool ret = true;
     if (data.CODE.Trim() == "")
     {
         _error = "¡ÃسÒÃкØÃËÑÊ»ÃÐàÀ·ÅÙ¡¤éÒ";
         ret = false;
     }
     else if (data.NAME.Trim() == "")
     {
         _error = "¡ÃسÒÃкت×èÍ»ÃÐàÀ·ÅÙ¡¤éÒ";
         ret = false;
     }
     return ret;
 }
Ejemplo n.º 3
0
        public bool UpdateData(string userID, CustomerTypeSearchData data)
        {
            bool ret = true;
            if (VeridateData(data))
            {

                OracleDBObj obj = new OracleDBObj();
                obj.CreateConnection();
                obj.CreateTransaction();
                try
                {
                    DALObj.GetDataByLOID(data.LOID, obj.zTrans);
                    DALObj.LOID = data.LOID;
                    DALObj.NAME = data.NAME.Trim();
                    DALObj.DESCRIPTION = data.DESCRIPTION.Trim();
                    DALObj.ACTIVE = data.ACTIVE.Trim();
                    DALObj.CODE = data.CODE.Trim();
                    DALObj.DISCOUNT = data.DISCOUNT;
                    DALObj.LOWERPRICE = data.LOWERPRICE;

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

                    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;
        }