Exemplo n.º 1
0
 public static void InitCtrlDanhSachLich(PLLookupEdit lookup)
 {
     string sql = string.Format(@"SELECT ID, NAME, LOAI_LICH,'' LOAI_LICH_NAME
                    From {0}
                    where VISIBLE_BIT='Y' and LOAI_LICH IS NOT NULL AND LOAI_LICH>0 AND 1=1", TABLE_MAP);
     var query = new QueryBuilder(sql);
     query.setAscOrderBy("lower(NAME)");
     DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
     if (ds != null && ds.Tables.Count > 0)
     {
         var dt = ds.Tables[0];
         foreach (DataRow r in dt.Rows)
         {
             r["LOAI_LICH_NAME"] = AppUtil.GetTitleLoaiLich((LoaiLich) HelpNumber.ParseInt32(r["LOAI_LICH"]));
         }
         lookup._init(dt, "NAME", "ID", "",
                      new[]
                          {
                              "NAME", "LOAI_LICH_NAME"
                          },
                      new[]
                          {
                              "Kênh phát", "Loại lịch"
                          },
                      new[] {100, 100},
                      false
             );
         if (dt.Rows.Count > 0)
         {
             var kenhphat = AppCtrl.GetDefaultKenhPhat();
             if (dt.Select("ID=" + kenhphat).Length == 0)
             {
                 kenhphat = HelpNumber.ParseInt64(dt.Rows[0]["ID"]);
             }
             lookup._setSelectedID(kenhphat);
         }
     }
 }
Exemplo n.º 2
0
 public static void ChonNhanVien_LookupEdit(PLLookupEdit input)
 {
     string Sql = "Select NV.* from DM_NHAN_VIEN NV inner join USER_CAT US on nv.id=us.employee_id where 1=1";
     QueryBuilder query = new QueryBuilder(Sql);
     DataSet ds = HelpDB.getDatabase().LoadDataSet(query);
     string[] fieldnames = { "NAME", "NGAY_SINH", "DIA_CHI", "DIEN_THOAI", "EMAIL" };
     string[] titlers = { "TenNV", "Ngày sinh", "Địa chỉ", "Điện thoại", "Email" };
     int[] widths = { 100, 100, 100, 100, 100 };
     input._init(ds.Tables[0], "NAME", "ID", "", fieldnames, titlers, widths);
     input._lookUpEdit.AutoSizeInLayoutControl = true;
     input._lookUpEdit.Properties.PopupWidth = 500;
 }