Exemplo n.º 1
0
 private bool VerifyData(StockCheckItemData data)
 {
     bool ret = true;
     if (data.PRODUCT == 0)
     {
         ret = false;
         _error = "¡ÃسÒÃкØÊÔ¹¤éÒ";
     }
     else if (data.LOTNO == "")
     {
         ret = false;
         _error = "¡ÃسÒàÅ×Í¡ Lot No";
     }
     else if (data.COUNTQTY == 0)
     {
         ret = false;
         _error = "¡ÃسÒÃкبӹǹ·Õè¹Ñºä´é";
     }
     return ret;
 }
Exemplo n.º 2
0
        public bool insertStockCheckItem(string userID, StockCheckItemData data)
        {
            bool ret = true;
            if (VerifyData(data))
            {
                OracleDBObj obj = new OracleDBObj();
                obj.CreateConnection();
                obj.CreateTransaction();
                try
                {
                    DALItemObj.OnDB = false;
                    DALItemObj.COUNTQTY = data.COUNTQTY;
                    DALItemObj.LOTNO = data.LOTNO;
                    DALItemObj.PRODUCT = data.PRODUCT;
                    DALItemObj.STOCKCHECK = data.STOCKCHECK;
                    DALItemObj.LOCATION = data.LOCATION;

                    ret = DALItemObj.InsertCurrentData(userID, obj.zTrans);
                    if (!ret) throw new ApplicationException(DALItemObj.ErrorMessage);

                    obj.zTrans.Commit();
                    obj.CloseConnection();
                }
                catch (Exception ex)
                {
                    obj.zTrans.Rollback();
                    obj.CloseConnection();
                    ret = false;
                    _error = ex.Message;
                }
            }
            else
            {
                ret = false;
            }
            return ret;
        }
Exemplo n.º 3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.pnlMessage.Visible)
        {
            ResetState();
        }
        else
        {
            try
            {
                StockCheckItemData data = new StockCheckItemData();
                data.PRODUCT = Convert.ToDouble(this.txtProduct.Text == "" ? "0" : this.txtProduct.Text);
                if (this.cmbLotNo.SelectedValue != "")
                    data.LOTNO = this.cmbLotNo.SelectedItem.Text;
                data.COUNTQTY = Convert.ToDouble(this.txtQty.Text == "" ? "0" : this.txtQty.Text);
                data.STOCKCHECK = Convert.ToDouble(this.txtLOID.Text);
                data.LOCATION = Convert.ToDouble(this.txtLocation.Text);

                if (FlowObj.insertStockCheckItem(Authz.CurrentUserInfo.UserID, data))
                    ResetState();
                else
                    SetError(FlowObj.ErrorMessage);
            }
            catch (Exception ex)
            {
                SetError(ex.Message);
            }
        }
    }