コード例 #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }

        _saveOperation = new SaveOperation();
        try
        {
            _saveOperation.WebPage  = this.Page;
            _saveOperation.Xml_File = "notes.xml";

            //extddlNoteType.Text = extddlNType.Text;

            if (chkReminderPopup.Checked == true)
            {
                extddlNType.Text = "NTY0004";
            }

            _saveOperation.SaveMethod();
            grdNotes.XGridBindSearch();

            extddlFilter.Selected_Text = "GENERAL";
            if (extddlNType.Text == "NTY0004" && txtNoteDesc.Text != "")
            {
                try
                {
                    Reminders.ReminderBO objReminder = new ReminderBO();
                    DataSet  dsReminder      = null;
                    string   str_description = "";
                    string   str_assigned_to = "";
                    string   str_assigned_by = "";
                    string   str_case_id     = "";
                    string   str_docotr_id   = "";
                    DateTime dt_start_date;
                    DateTime dt_end_date            = Convert.ToDateTime(System.DateTime.Now.AddYears(2).ToShortDateString());
                    int      i_is_recurrence        = 0;
                    int      i_recurrence_type      = 0;
                    int      i_occurrence_end_count = 0;
                    int      i_day_option           = 0;
                    int      i_d_day_count          = 0;
                    int      i_d_every_weekday      = 0;
                    int      i_w_recur_week_count   = 0;
                    int      i_w_sunday             = 0;
                    int      i_w_monday             = 0;
                    int      i_w_tuesday            = 0;
                    int      i_w_wednesday          = 0;
                    int      i_w_thursday           = 0;
                    int      i_w_friday             = 0;
                    int      i_w_saturday           = 0;
                    int      i_month_option         = 0;
                    int      i_m_day               = 0;
                    int      i_m_month_count       = 0;
                    int      i_m_term              = 100;
                    int      i_m_term_week         = 100;
                    int      i_m_every_month_count = 0;
                    int      i_year_option         = 0;
                    int      i_y_month             = 100;
                    int      i_y_day               = 0;
                    int      i_y_term              = 100;
                    int      i_y_term_week         = 100;
                    int      i_y_every_month_count = 100;
                    string   strReminderStatus     = "RS000000000000000001";

                    Session["ReminiderNotes"] = "";

                    str_description = txtNoteDesc.Text.Trim().ToString();
                    str_description = str_description.Replace('\n', ' ');
                    str_description = str_description.Replace('\r', ' ');

                    if (txtUserID.Text != "")
                    {
                        str_assigned_by = txtUserID.Text.Trim().ToString();
                    }
                    dt_start_date = System.DateTime.Now.Date;

                    str_assigned_to = txtUserID.Text.Trim().ToString();

                    i_occurrence_end_count = 1;



                    if (((Bill_Sys_CaseObject)Session["CASE_OBJECT"]) != null)
                    {
                        str_case_id = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
                    }
                    string strCompanyID = txtCompanyID.Text;


                    dsReminder = objReminder.SetReminderDetailsForCase(str_description, str_assigned_to, str_assigned_by, strReminderStatus, dt_start_date, dt_end_date, i_is_recurrence, i_recurrence_type, i_occurrence_end_count, i_day_option, i_d_day_count, i_d_every_weekday, i_w_recur_week_count, i_w_sunday, i_w_monday, i_w_tuesday, i_w_wednesday, i_w_thursday, i_w_friday, i_w_saturday, i_month_option, i_m_day, i_m_month_count, i_m_term, i_m_term_week, i_m_every_month_count, i_year_option, i_y_month, i_y_day, i_y_term, i_y_term_week, i_y_every_month_count, str_docotr_id, str_case_id, strCompanyID, "CASE", "", "");
                    if (dsReminder.Tables.Count > 0)
                    {
                        if (dsReminder.Tables[0].Rows.Count > 0)
                        {
                            if (dsReminder.Tables[0].Rows[0]["result"].ToString() == "1")
                            {
                                Session["ReminiderNotes"] = true;
                                ScriptManager.RegisterClientScriptBlock(btnSave, typeof(Button), "Msg", "ClearValues();alert('Reminder details added successfully...!!')", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(btnSave, typeof(Button), "Msg", "ClearValues();alert('Failed to add reminder details..!!')", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(btnSave, typeof(Button), "Msg", "ClearValues();alert('Failed to add reminder details..!!')", true);
                    }
                }
                catch (Exception ex)
                {
                    Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                    using (Utils utility = new Utils())
                    {
                        utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
                    }
                    string str2 = "Error Request=" + id + ".Please share with Technical support.";
                    base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
                }
            }
            ClearControl();
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End

        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
コード例 #2
0
ファイル: Bill_Sys_Notes.aspx.cs プロジェクト: jehan2898/root
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        this._saveOperation = new SaveOperation();
        try
        {
            this._saveOperation.WebPage  = this.Page;
            this._saveOperation.Xml_File = "notes.xml";
            if (this.chkReminderPopup.Checked)
            {
                this.extddlNType.Text = "NTY0004";
            }
            this._saveOperation.SaveMethod();
            this.grdNotes.XGridBindSearch();
            this.extddlFilter.Selected_Text = "GENERAL";
            if (this.extddlNType.Text == "NTY0004" && this.txtNoteDesc.Text != "")
            {
                try
                {
                    ReminderBO reminderBO = new ReminderBO();
                    DataSet    dataSet    = null;
                    string     str        = "";
                    string     str1       = "";
                    string     str2       = "";
                    string     sZCASEID   = "";
                    string     str3       = "";
                    DateTime   dateTime   = DateTime.Now.AddYears(2);
                    DateTime   dateTime1  = Convert.ToDateTime(dateTime.ToShortDateString());
                    int        num        = 0;
                    int        num1       = 0;
                    int        num2       = 0;
                    int        num3       = 0;
                    int        num4       = 0;
                    int        num5       = 0;
                    int        num6       = 0;
                    int        num7       = 0;
                    int        num8       = 0;
                    int        num9       = 0;
                    int        num10      = 0;
                    int        num11      = 0;
                    int        num12      = 0;
                    int        num13      = 0;
                    int        num14      = 0;
                    int        num15      = 0;
                    int        num16      = 0;
                    int        num17      = 100;
                    int        num18      = 100;
                    int        num19      = 0;
                    int        num20      = 0;
                    int        num21      = 100;
                    int        num22      = 0;
                    int        num23      = 100;
                    int        num24      = 100;
                    int        num25      = 100;
                    string     str4       = "RS000000000000000001";
                    this.Session["ReminiderNotes"] = "";
                    str = this.txtNoteDesc.Text.Trim().ToString();
                    str = str.Replace('\n', ' ');
                    str = str.Replace('\r', ' ');
                    if (this.txtUserID.Text != "")
                    {
                        str2 = this.txtUserID.Text.Trim().ToString();
                    }
                    DateTime date = DateTime.Now.Date;
                    str1 = this.txtUserID.Text.Trim().ToString();
                    num2 = 1;
                    if ((Bill_Sys_CaseObject)this.Session["CASE_OBJECT"] != null)
                    {
                        sZCASEID = ((Bill_Sys_CaseObject)this.Session["CASE_OBJECT"]).SZ_CASE_ID;
                    }
                    string text = this.txtCompanyID.Text;
                    dataSet = reminderBO.SetReminderDetailsForCase(str, str1, str2, str4, date, dateTime1, num, num1, num2, num3, num4, num5, num6, num7, num8, num9, num10, num11, num12, num13, num14, num15, num16, num17, num18, num19, num20, num21, num22, num23, num24, num25, str3, sZCASEID, text, "CASE", "", "");
                    if (dataSet.Tables.Count <= 0)
                    {
                        ScriptManager.RegisterClientScriptBlock(this.btnSave, typeof(Button), "Msg", "ClearValues();alert('Failed to add reminder details..!!')", true);
                    }
                    else if (dataSet.Tables[0].Rows.Count <= 0)
                    {
                        ScriptManager.RegisterClientScriptBlock(this.btnSave, typeof(Button), "Msg", "ClearValues();alert('Failed to add reminder details..!!')", true);
                    }
                    else if (dataSet.Tables[0].Rows[0]["result"].ToString() == "1")
                    {
                        this.Session["ReminiderNotes"] = true;
                        ScriptManager.RegisterClientScriptBlock(this.btnSave, typeof(Button), "Msg", "ClearValues();alert('Reminder details added successfully...!!')", true);
                    }
                }
                catch (Exception exception)
                {
                    exception.ToString();
                }
            }
            this.ClearControl();
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }