Esempio n. 1
0
        public BindBudget GetModel(int NoteId)
        {
            string sqlString = "";

            sqlString = "select NoteId,PrjCode,Templatescode,TaskCode from BindBudget ";
            sqlString = sqlString + " where NoteId=" + NoteId;
            BindBudget budget = new BindBudget();
            DataSet    set    = publicDbOpClass.DataSetQuary(sqlString);

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["NoteId"].ToString() != "")
            {
                budget.NoteId = Convert.ToInt32(set.Tables[0].Rows[0]["NoteId"].ToString());
            }
            if (set.Tables[0].Rows[0]["PrjCode"].ToString() != "")
            {
                budget.PrjCode = new Guid(set.Tables[0].Rows[0]["PrjCode"].ToString());
            }
            budget.Templatescode = set.Tables[0].Rows[0]["Templatescode"].ToString();
            budget.TaskCode      = set.Tables[0].Rows[0]["TaskCode"].ToString();
            return(budget);
        }
Esempio n. 2
0
        public bool Update(BindBudget model)
        {
            string str = "";

            str = "update BindBudget set ";
            return(publicDbOpClass.ExecSqlString(((string.Concat(new object[] { str, "PrjCode='", model.PrjCode, "'," }) + "Templatescode='" + model.Templatescode + "',") + "TaskCode='" + model.TaskCode + "'") + " where NoteId=" + model.NoteId) > 0);
        }
Esempio n. 3
0
        public static bool Add(BindBudget model)
        {
            string str = "";

            str = "insert into BindBudget(";
            str = str + "PrjCode,Templatescode,TaskCode)" + " values ('";
            return(publicDbOpClass.ExecSqlString(string.Concat(new object[] { str, model.PrjCode, "','", model.Templatescode, "','", model.TaskCode, "')" })) > 0);
        }