protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { //Lấy data ct obj = (ct)e.Item.DataItem; if (obj == null) { return; } //Set ID (unique id) HtmlInputCheckBox cbxSelect = e.Item.FindControl("cbxcheck") as HtmlInputCheckBox; if (cbxSelect != null) { ID = Convert.ToString(obj.ID); cbxSelect.Attributes.Add("uid", obj.ID.ToString()); } //set image } catch (Exception ex) { Global.WriteLogError("rptData_ItemDataBound : " + ex); } }
private void IniUpdate(string ID) { Data objdata = new Data(Global.ConnectionSql); try { ct obj = new ct(); obj.DataObject = objdata; if (obj.GetByID(ID)) { txtTitle.Text = obj.Title; radContents.Content = obj.Detail; Handle = HandleValue.Edit; lblHandle.Text = "Sửa nội dung"; mdPopup.Show(); } } catch (Exception ex) { Global.WriteLogError("IniUpdate" + ex); } finally { objdata.DeConnect(); } }
public co(ct type, string[] commandParams) { this.Type = type; this.Title = commandParams[(int)acpi.Title]; this.Author = commandParams[(int)acpi.Author]; this.Size = Int64.Parse(commandParams[(int)acpi.Size]); this.URL = commandParams[(int)acpi.Url]; }
private void GetIntroduct(string ID) { Data objdata = new Data(Global.ConnectionSql); try { ct obj = new ct(); obj.DataObject = objdata; obj.GetByID(ID); _content = obj.Detail; _title = obj.Title; } catch (Exception ex) { Global.WriteLogError("GetIntroduct ()" + ex); } finally { objdata.DeConnect(); } }
private ctCollection LoadData(string stextsearch) { Data objdata = new Data(Global.ConnectionSql); ctCollection col = null; try { ct obj = new ct(); obj.DataObject = objdata; col = obj.Getlist(stextsearch); } catch (Exception ex) { Global.WriteLogError("LoadCategory()" + ex); } finally { objdata.DeConnect(); } return(col); }
private bool Deleted(string id) { Data objdata = new Data(Global.ConnectionSql); bool ok = false; try { ct obj = new ct(); obj.DataObject = objdata; ok = obj.Delete(id); } catch (Exception ex) { Global.WriteLogError("Deleted() " + ex); } finally { objdata.DeConnect(); } return(ok); }
private void Insert() { Data objdata = new Data(Global.ConnectionSql); try { ct obj = new ct(); obj.DataObject = objdata; obj.Title = txtTitle.Text.Trim(); obj.ID = Global.FilterFileName(txtTitle.Text.Trim()); obj.Detail = radContents.Content; int result = Convert.ToInt32(obj.Add()); if (result > 0) { this.BindingData(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "sucess", "messagesucess();", true); } else if (result == 0) { lblmessage.Text = "Dữ liệu bị trùng. Vui lòng kiểm tra lại !"; mdPopup.Show(); return; } else { lblmessage.Text = "Lỗi xảy ra. Vui lòng liên hệ người quản trị để khắc phục !"; Global.WriteLogError("Insert() " + ""); mdPopup.Show(); } } catch (Exception ex) { Global.WriteLogError("Insert() " + ex); } finally { objdata.DeConnect(); } }
private void Update(string id) { Data objdata = new Data(Global.ConnectionSql); try { ct obj = new ct(); obj.DataObject = objdata; obj.ID = id; obj.Title = txtTitle.Text.Trim(); obj.Detail = radContents.Content; int iResult = Convert.ToInt32(obj.Update()); if (iResult > 0) { this.BindingData(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "sucess", "messagesucess();", true); } else if (iResult == 0) { lblmessage.Text = "Trùng dữ liệu vui lòng kiểm tra lại"; mdPopup.Show(); } else { lblmessage.Text = "Lỗi xảy ra trong quá trình lưu dữ liệu. Liên hệ với người quản trị để khắc phục"; mdPopup.Show(); } } catch (Exception ex) { Global.WriteLogError("Update () " + ex); lblmessage.Text = "Lỗi xảy ra trong quá trình lưu dữ liệu. Liên hệ với người quản trị để khắc phục"; mdPopup.Show(); } finally { objdata.DeConnect(); } }
? CreateObjectInitializer(ct, token as JObject, indent)
=> new AsyncOperationWithProgress <IBuffer, uint>(async(ct, op) => { var endPosition = (ulong)_stream.Position + (_initialPosition ?? 0) + count;
await Exec(cmd, args, ct, sudo, false, false);
Assert.AreEqual(input.expectedOutput, grid.OnRing(ct, input.radius, cc));