Esempio n. 1
0
    protected void m_grid_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string message = "";

        try
        {
            SectionServiceError m_SectionServiceError = new SectionServiceError();
            m_SectionServiceError.SectionServiceErrorId = System.Int32.Parse(m_grid.DataKeys[e.RowIndex].Value.ToString());
            m_SectionServiceError.Delete();
        }
        catch (Exception ex)
        {
            sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
        }
        ShowGrid();
    }
Esempio n. 2
0
 private void bindData()
 {
     System.Int32 EditId;
     if (Request.QueryString["id"] == null)
     {
         return;
     }
     else
     {
         EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
         SectionServiceError m_SectionServiceError = new SectionServiceError();
         m_SectionServiceError.SectionServiceErrorId = EditId;
         m_SectionServiceError   = m_SectionServiceError.Get();
         txSectionServiceId.Text = m_SectionServiceError.SectionServiceId.ToString();
         txSectionErrorId.Text   = m_SectionServiceError.SectionErrorId.ToString();
         txErrorContent.Text     = m_SectionServiceError.ErrorContent.ToString();
         txStatusId.Text         = m_SectionServiceError.StatusId.ToString();
     }
 }
Esempio n. 3
0
    //--------------------------------------------------------------------------------

    private void ShowGrid()
    {
        try
        {
            SectionServiceError m_SectionServiceError = new SectionServiceError();
            m_SectionServiceError.SectionServiceErroName = txtSearch.Text;
            string DateFrom = txtDateFrom.Text;
            string DateTo   = txtDateTo.Text;
            int    RowCount = 0;
            List <SectionServiceError> l_SectionServiceError = m_SectionServiceError.GetPage("", "", ddlOrderBy.SelectedValue, m_grid.PageSize, CustomPaging.PageIndex - 1, ref RowCount);

            m_grid.DataSource = l_SectionServiceError;
            m_grid.DataBind();
            lblTong.Text           = RowCount.ToString();
            CustomPaging.TotalPage = (RowCount == 0) ? 1 : (RowCount % m_grid.PageSize == 0) ? RowCount / m_grid.PageSize : (RowCount - RowCount % m_grid.PageSize) / m_grid.PageSize + 1;
        }
        catch (Exception ex)
        {
            sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
        }
    }
Esempio n. 4
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     try
     {
         SectionServiceError m_SectionServiceError = new SectionServiceError();
         foreach (GridViewRow m_Row in m_grid.Rows)
         {
             CheckBox chkAction = (CheckBox)m_Row.FindControl("chkAction");
             if (chkAction != null)
             {
                 if (chkAction.Checked)
                 {
                     m_SectionServiceError.SectionServiceErrorId = System.Int32.Parse(m_grid.DataKeys[m_Row.RowIndex].Value.ToString());
                     m_SectionServiceError.Delete();
                 }
             }
         }
         ShowGrid();
     }
     catch (Exception ex)
     {
         sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
     }
 }
Esempio n. 5
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int32        EditId;
        SectionServiceError m_SectionServiceError = new SectionServiceError();

        if (Request.QueryString["id"] == null)
        {
            EditId = 0;
        }
        else
        {
            EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
            m_SectionServiceError.SectionServiceErrorId = EditId;
            m_SectionServiceError = m_SectionServiceError.Get();
        }
        try
        {
            if (txSectionServiceId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txSectionErrorId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txErrorContent.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txStatusId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }


            m_SectionServiceError.CrUserId = ActUserId;

            m_SectionServiceError.SectionServiceId = int.Parse(txSectionServiceId.Text);

            m_SectionServiceError.SectionErrorId = int.Parse(txSectionErrorId.Text);

            if (txErrorContent.Text != "")
            {
                m_SectionServiceError.ErrorContent = txErrorContent.Text;
            }

            m_SectionServiceError.StatusId = byte.Parse(txStatusId.Text);

            m_SectionServiceError.SectionServiceErrorId = EditId;
            SysMessageTypeId = m_SectionServiceError.InsertOrUpdate(ConstantHelpers.Replicated, ActUserId, ref SysMessageId);

            StringBuilder       csText = new StringBuilder();
            Type                cstype = this.GetType();
            ClientScriptManager cs     = Page.ClientScript;
            csText.Clear();
            csText.Append("<script type=\"text/javascript\">");
            csText.Append("window.parent.jQuery('#divEdit').dialog('close');");
            csText.Append("</script>");
            cs = Page.ClientScript;
            cs.RegisterClientScriptBlock(this.GetType(), "system_message", csText.ToString());
        }
        catch (Exception ex)
        {
            sms.utils.LogFiles.LogError(((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name + "\t" + ex.ToString());
            JSAlertHelpers.Alert(ex.Message, this);
        }
    }