Пример #1
0
 public static QueryBuilder find_DSPhieu_Object(PhieuInfo phieu, string obj_field, string obj_key)
 {
     QueryBuilder filter = new QueryBuilder("select * from " + phieu.TableName + " where 1=1");
     filter.addCondition(obj_field + "='" + obj_key + "'");
     return filter;
 }
Пример #2
0
 public List<PhieuInfo> getAllPhieu()
 {
     List<PhieuInfo> list = new List<PhieuInfo>();
     QueryBuilder query = new QueryBuilder("select fp.form_class_name, fp.id, fp.caption, " +
         "fp.key_field, fp.obj_field, fp.ma_field_name, fp.ngay_tao_fn, " +
         "fp.ngay_cn_fn, fp.table_name, fp.class_name from fw_phieu fp " +
         "inner join fw_obj_phieu fo on (fp.id=fo.phieu_id) " +
         "where obj_id='" + Id + "'" + " and 1=1");
     DataSet ds = DABase.getDatabase().LoadDataSet(query);
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         PhieuInfo phieu = new PhieuInfo();
         phieu.Id = (long)dr["ID"];
         phieu.Title = dr["CAPTION"].ToString();
         phieu.Key_field = dr["KEY_FIELD"].ToString();
         phieu.Obj_field = dr["OBJ_FIELD"].ToString();
         phieu.Ma_field_name = dr["MA_FIELD_NAME"].ToString();
         phieu.Ngay_tao_fn = dr["NGAY_TAO_FN"].ToString();
         phieu.Ngay_cn_fn = dr["NGAY_CN_FN"].ToString();
         phieu.TableName = dr["TABLE_NAME"].ToString();
         phieu.ClassName = dr["CLASS_NAME"].ToString();
         phieu.Form_Class_Name = dr["FORM_CLASS_NAME"].ToString();
         list.Add(phieu);
     }
     return list;
 }
Пример #3
0
 private QueryBuilder BuildFilterString_Phieu(PhieuInfo phieu, QueryBuilder query)
 {
     query.addSoPhieu(phieu.Ma_field_name, MaPhieu.Text);
     query.addDateFromTo(phieu.Ngay_tao_fn, NgayTao_tu.DateTime, NgayTao_den.DateTime);
     query.addDateFromTo(phieu.Ngay_cn_fn, NgayCN_tu.DateTime, NgayCN_den.DateTime);
     return query;
 }