Esempio n. 1
0
        public com.jwsoft.pm.entpm.model.RealTime GetModel(int RecordID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select   ");
            builder.Append(" RecordID,DepositoryID,MaterialId,Amount ");
            builder.Append(" from pm_Repe_RealTime ");
            builder.Append(" where RecordID=" + RecordID + " ");
            com.jwsoft.pm.entpm.model.RealTime time = new com.jwsoft.pm.entpm.model.RealTime();
            DataSet set = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["RecordID"].ToString() != "")
            {
                time.RecordID = int.Parse(set.Tables[0].Rows[0]["RecordID"].ToString());
            }
            if (set.Tables[0].Rows[0]["DepositoryID"].ToString() != "")
            {
                time.DepositoryID = int.Parse(set.Tables[0].Rows[0]["DepositoryID"].ToString());
            }
            if (set.Tables[0].Rows[0]["MaterialId"].ToString() != "")
            {
                time.MaterialId = int.Parse(set.Tables[0].Rows[0]["MaterialId"].ToString());
            }
            if (set.Tables[0].Rows[0]["Amount"].ToString() != "")
            {
                time.Amount = decimal.Parse(set.Tables[0].Rows[0]["Amount"].ToString());
            }
            return(time);
        }
Esempio n. 2
0
        public bool Update(com.jwsoft.pm.entpm.model.RealTime model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update pm_Repe_RealTime set ");
            builder.Append("DepositoryID=" + model.DepositoryID + ",");
            builder.Append("MaterialId=" + model.MaterialId + ",");
            builder.Append("Amount=" + model.Amount);
            builder.Append(" where RecordID=" + model.RecordID + " ");
            return(publicDbOpClass.NonQuerySqlString(builder.ToString()));
        }
Esempio n. 3
0
        public bool Add(com.jwsoft.pm.entpm.model.RealTime model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into pm_Repe_RealTime(");
            builder.Append("DepositoryID,MaterialId,Amount");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append(model.DepositoryID + ",");
            builder.Append(model.MaterialId + ",");
            builder.Append(model.Amount);
            builder.Append(")");
            return(publicDbOpClass.NonQuerySqlString(builder.ToString()));
        }