Example #1
0
        public bool Update(com.jwsoft.pm.entpm.model.InventoryDetail model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update pm_Repe_InventoryDetail set ");
            builder.Append("InventoryID=" + model.InventoryID + ",");
            builder.Append("MaterialId=" + model.MaterialId + ",");
            builder.Append("UnitPrice=" + model.UnitPrice + ",");
            builder.Append("BookScalar=" + model.BookScalar + ",");
            builder.Append("FactScalar=" + model.FactScalar);
            builder.Append(" where InventoryDetailID=" + model.InventoryDetailID + " ");
            return(publicDbOpClass.NonQuerySqlString(builder.ToString()));
        }
Example #2
0
        public bool Add(com.jwsoft.pm.entpm.model.InventoryDetail model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into pm_Repe_InventoryDetail(");
            builder.Append("InventoryID,MaterialId,UnitPrice,BookScalar,FactScalar");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append(model.InventoryID + ",");
            builder.Append(model.MaterialId + ",");
            builder.Append(model.UnitPrice + ",");
            builder.Append(model.BookScalar + ",");
            builder.Append(model.FactScalar);
            builder.Append(")");
            return(publicDbOpClass.NonQuerySqlString(builder.ToString()));
        }
Example #3
0
        public com.jwsoft.pm.entpm.model.InventoryDetail GetModel(int InventoryDetailID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select   ");
            builder.Append(" InventoryDetailID,InventoryID,MaterialId,UnitPrice,BookScalar,FactScalar ");
            builder.Append(" from pm_Repe_InventoryDetail ");
            builder.Append(" where InventoryDetailID=" + InventoryDetailID + " ");
            com.jwsoft.pm.entpm.model.InventoryDetail detail = new com.jwsoft.pm.entpm.model.InventoryDetail();
            DataSet set = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["InventoryDetailID"].ToString() != "")
            {
                detail.InventoryDetailID = int.Parse(set.Tables[0].Rows[0]["InventoryDetailID"].ToString());
            }
            if (set.Tables[0].Rows[0]["InventoryID"].ToString() != "")
            {
                detail.InventoryID = int.Parse(set.Tables[0].Rows[0]["InventoryID"].ToString());
            }
            if (set.Tables[0].Rows[0]["MaterialId"].ToString() != "")
            {
                detail.MaterialId = int.Parse(set.Tables[0].Rows[0]["MaterialId"].ToString());
            }
            if (set.Tables[0].Rows[0]["UnitPrice"].ToString() != "")
            {
                detail.UnitPrice = decimal.Parse(set.Tables[0].Rows[0]["UnitPrice"].ToString());
            }
            if (set.Tables[0].Rows[0]["BookScalar"].ToString() != "")
            {
                detail.BookScalar = decimal.Parse(set.Tables[0].Rows[0]["BookScalar"].ToString());
            }
            if (set.Tables[0].Rows[0]["FactScalar"].ToString() != "")
            {
                detail.FactScalar = decimal.Parse(set.Tables[0].Rows[0]["FactScalar"].ToString());
            }
            return(detail);
        }