Exemple #1
0
    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);
        }
    }
Exemple #2
0
    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();
        }
    }
Exemple #3
0
 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];
 }
Exemple #4
0
    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();
        }
    }
Exemple #5
0
    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);
    }
Exemple #6
0
    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);
    }
Exemple #7
0
    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();
        }
    }
Exemple #8
0
    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)
Exemple #10
0
 => new AsyncOperationWithProgress <IBuffer, uint>(async(ct, op) =>
 {
     var endPosition = (ulong)_stream.Position + (_initialPosition ?? 0) + count;
Exemple #11
0
 await Exec(cmd, args, ct, sudo, false, false);
Exemple #12
0
 Assert.AreEqual(input.expectedOutput, grid.OnRing(ct, input.radius, cc));