Example #1
0
        public void DeleteBTOceanOrderByPdlineAndModel(string pdLine, string model)
        {
            try
            {
                MethodBase mthObj = MethodBase.GetCurrentMethod();
                int tk = mthObj.MetadataToken;
                SQLContextNew sqlCtx = null;
                lock (mthObj)
                {
                    if (!SQLCache.PeerTheSQL(tk, out sqlCtx))
                    {
                        Bt_Seashipmentsku cond = new Bt_Seashipmentsku();
                        cond.pdLine = pdLine;
                        cond.model = model;
                        sqlCtx = FuncNew.GetConditionedDelete<Bt_Seashipmentsku>(tk, new ConditionCollection<Bt_Seashipmentsku>(new EqualCondition<Bt_Seashipmentsku>(cond)));
                    }
                }
                sqlCtx.Param(Bt_Seashipmentsku.fn_pdLine).Value = pdLine;
                sqlCtx.Param(Bt_Seashipmentsku.fn_model).Value = model;

                _Schema.SqlHelper.ExecuteNonQuery(_Schema.SqlHelper.ConnectionString_PAK, CommandType.Text, sqlCtx.Sentence, sqlCtx.Params);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public void UpdateBTOceanOrderbyPdlineAndModel(BTOceanOrder obj, string pdLine, string model)
        {
            try
            {
                MethodBase mthObj = MethodBase.GetCurrentMethod();
                int tk = mthObj.MetadataToken;
                SQLContextNew sqlCtx = null;
                lock (mthObj)
                {
                    if (!SQLCache.PeerTheSQL(tk, out sqlCtx))
                    {
                        Bt_Seashipmentsku cond = new Bt_Seashipmentsku();
                        cond.pdLine = pdLine;
                        cond.model = model;
                        Bt_Seashipmentsku setv = FuncNew.SetColumnFromField<Bt_Seashipmentsku, BTOceanOrder>(obj, Bt_Seashipmentsku.fn_id, Bt_Seashipmentsku.fn_cdt);
                        setv.udt = DateTime.Now;
                        sqlCtx = FuncNew.GetConditionedUpdate<Bt_Seashipmentsku>(tk, new SetValueCollection<Bt_Seashipmentsku>(new CommonSetValue<Bt_Seashipmentsku>(setv)), new ConditionCollection<Bt_Seashipmentsku>(new EqualCondition<Bt_Seashipmentsku>(cond)));
                    }
                }
                sqlCtx.Param(Bt_Seashipmentsku.fn_pdLine).Value = pdLine;
                sqlCtx.Param(Bt_Seashipmentsku.fn_model).Value = model;

                sqlCtx = FuncNew.SetColumnFromField<Bt_Seashipmentsku, BTOceanOrder>(sqlCtx, obj, true);
                DateTime cmDt = _Schema.SqlHelper.GetDateTime();
                sqlCtx.Param(g.DecSV(Bt_Seashipmentsku.fn_udt)).Value = cmDt;

                _Schema.SqlHelper.ExecuteNonQuery(_Schema.SqlHelper.ConnectionString_PAK, CommandType.Text, sqlCtx.Sentence, sqlCtx.Params);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
        public IList<BTOceanOrder> GetListByPdLineAndModel(string pdLine, string model)
        {
            try
            {
                IList<BTOceanOrder> ret = null;

                MethodBase mthObj = MethodBase.GetCurrentMethod();
                int tk = mthObj.MetadataToken;
                SQLContextNew sqlCtx = null;
                lock (mthObj)
                {
                    if (!SQLCache.PeerTheSQL(tk, out sqlCtx))
                    {
                        Bt_Seashipmentsku cond = new Bt_Seashipmentsku();
                        cond.pdLine = pdLine;
                        cond.model = model;
                        sqlCtx = FuncNew.GetConditionedSelect<Bt_Seashipmentsku>(tk, null, null, new ConditionCollection<Bt_Seashipmentsku>(new EqualCondition<Bt_Seashipmentsku>(cond)), Bt_Seashipmentsku.fn_id);
                    }
                }
                sqlCtx.Param(Bt_Seashipmentsku.fn_pdLine).Value = pdLine;
                sqlCtx.Param(Bt_Seashipmentsku.fn_model).Value = model;

                using (SqlDataReader sqlR = _Schema.SqlHelper.ExecuteReader(_Schema.SqlHelper.ConnectionString_PAK, CommandType.Text, sqlCtx.Sentence, sqlCtx.Params))
                {
                    ret = FuncNew.SetFieldFromColumn<Bt_Seashipmentsku, BTOceanOrder, BTOceanOrder>(ret, sqlR, sqlCtx);
                }
                return ret;
            }
            catch (Exception)
            {
                throw;
            }
        }