Exemple #1
0
        //部门详细信息 Added Liangsx 2010-12-15
        public Org Detail(int id)
        {
            string strSql = "select * from bas_org where  id = " + id.ToString();
            Org model = new Org();
            DataRow dr = DataBase.ExecuteDataRow(strSql);
            model.Id = int.Parse(dr["id"].ToString());
            model.OrgName = dr["org_name"].ToString().Trim();
            model.LinkName = dr["link_name"].ToString().Trim();
            model.LinkTel = dr["link_tel"].ToString().Trim();
            model.LinkMobile = dr["link_mobile"].ToString().Trim();

            return model;
        }
Exemple #2
0
        public bool Add(Org model)
        {
            if (model == null)
                return false;
            StringBuilder strb = new StringBuilder();
            strb.Append(" Insert Into bas_org ");
            strb.Append(" ( ");
            //strb.Append("id, ");
            strb.Append("org_name, ");
            strb.Append("link_name, ");
            strb.Append("link_tel, ");
            strb.Append("link_mobile ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("" + model.Id + ", ");
            strb.Append("'" + model.OrgName + "', ");
            strb.Append("'" + model.LinkName + "', ");
            strb.Append("'" + model.LinkTel + "', ");
            strb.Append("'" + model.LinkMobile + "' ");
            strb.Append(" )");

            return DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false;
        }
Exemple #3
0
 public bool Update(Org model)
 {
     return dal.Update(model);
 }
Exemple #4
0
 public bool Add(Org model)
 {
     return dal.Add(model);
 }
Exemple #5
0
        public bool Update(Org model)
        {
            StringBuilder strb = new StringBuilder();
            strb.Append(" Update bas_org ");
            strb.Append(" Set ");
            //strb.Append("id               = " + model.Id + ",");
            strb.Append("org_name  = '" + model.OrgName + "',");
            strb.Append("link_name        = '" + model.LinkName + "',");
            strb.Append("link_tel         = '" + model.LinkTel + "',");
            strb.Append("link_mobile      = '" + model.LinkMobile + "'");
            strb.Append(" where id = " + model.Id);

            return DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false;
        }