Example #1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text != null)
            {
                string cat = string.Empty;
                string un  = TextBox1.Text;
                string pwd = TextBox2.Text;
                bl     c   = new bl();
                try
                {
                    cat = c.verpwd(un, pwd);
                }
                catch {
                    cat = null;
                }

                if (cat == "")
                {
                    Response.Write("<script>alert('Invalid Username / Password');</script>");
                }
                else
                {
                    Session["username"] = TextBox1.Text;

                    Server.Transfer("main.aspx");
                }
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                g.fileName = "";
            }

            CheckBox1.Checked = true;

            if (!IsPostBack)
            {
                bl add = new bl();

                try
                {
                    int refno = add.refret();
                    TextBox1.Text    = refno.ToString();
                    TextBox1.Enabled = false;
                }
                catch
                {
                    TextBox1.Text = "";
                }
            }
            TextBox3.Text = DateTime.Now.ToString();
            //TextBox3.Enabled = false;
            //add here
        }
Example #3
0
        public void TestMethod25()
        {
            // testing bl

            RegisterFile <Vector4> vRF = new RegisterFile <Vector4>(32);
            RegisterFile <Scalar>  sRF = new RegisterFile <Scalar>(33);
            Memory           m         = new Memory(5000);
            Memory           m_ic      = new Memory(5000);
            IntersectionCore ic        = new IntersectionCore(m_ic);



            cmp_f c = new cmp_f(1, 2);
            bl    b = new bl(5);

            sRF[1] = (float)1.5;
            sRF[2] = (float)1.5;
            c.Process(vRF, sRF, m, ic);

            b.Process(vRF, sRF, m, ic);

            Assert.AreEqual <int>(0, sRF[31].i);

            sRF[1] = (float)1;
            sRF[2] = (float)2;
            c.Process(vRF, sRF, m, ic);

            b.Process(vRF, sRF, m, ic);

            Assert.AreEqual <int>(5, sRF[31].i);
        }
Example #4
0
    public MySqlDataReader modreq(int refno)
    {
        HttpContext.Current.Server.ScriptTimeout = 900000;
        using (con = new MySqlConnection(str))
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            bl     modreq = new bl();
            string sql    = string.Format("select * from tbl_srvmast where Ref_No='{0}'", refno);
            cmd.CommandText    = sql;
            cmd.CommandTimeout = 50000;
            cmd.ExecuteNonQuery();

            MySqlDataReader dr = (cmd.ExecuteReader());

            if (dr.Read())
            {
                con.Close();
                return(dr);
            }
            else
            {
                return(null);
            }
        }
    }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string cid = Request.QueryString["order_no"];

            bl tabsho = new bl();

            GridView1.DataSource = tabsho.showgrid(cid);
            GridView1.DataBind();
            GridView1.Enabled = true;
            GridView1.Visible = true;
        }
Example #6
0
 public static bool blockTransparent(bl passed)
 {
     if (passed == bl.Air)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         bl  add   = new bl();
         int refno = add.refret();
         TextBox1.Text    = refno.ToString();
         TextBox1.Enabled = false;
     }
     TextBox1.Attributes.Add("onKeyDown()", "KeyDownHandler()");
 }
Example #8
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)

        {
            bool flag = true;

            string confrim_value = Request.Form["Confirm_Value"];

            if ((TextBox4.Text == ""))
            {
                Response.Write("<script>alert('Problem Cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if ((TextBox6.Text == ""))

            {
                Response.Write("<script>alert('Received Date Cannot be Blank')</script>");
                TextBox6.Focus();
                flag = false;
            }



            if ((confrim_value == "YES") && (flag == true))
            {
                int    Ref_No    = Int32.Parse(TextBox1.Text);
                string Rec_Date  = Calendar1.SelectedDate.ToShortDateString();
                string Prob_Desc = TextBox4.Text;
                string Type      = DropDownList2.SelectedItem.Text;
                string Remarks   = TextBox3.Text;
                string Req_Name  = TextBox2.Text;
                string Com_Type  = DropDownList3.SelectedValue.ToString();

                bl c = new bl();

                if (c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Remarks))
                {
                    Response.Write("<script> alert('Record Updated Successfully')</script>");
                    Response.Redirect("WebForm1.aspx");
                }

                else
                {
                    Response.Write("<script> alert('Update Unsuccessful')</script>");
                }
            }
            if (flag == false)
            {
                Response.Write("<script> alert('Update Unsuccessful')</script>");
            }
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string ordnohyp = string.Empty;
                ordnohyp = Request.QueryString["Order_No"];
                bl SHWGRID = new bl();

                GridView2.DataSource = SHWGRID.showgrid(ordnohyp);
                GridView2.DataBind();
                GridView2.Enabled = true;
                GridView2.Visible = true;
            }
        }
Example #10
0
 protected void GridView3_RowCommand1(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "ProdBtn")
     {
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = GridView3.Rows[index];
         HyperLink   hl    = (HyperLink)row.FindControl("HyperLink1");
         string      ordno = hl.Text;
         //   int n = hl.TabIndex;
         // TableCell sitenamecell = row.Cells[n];
         // string orderno = sitenamecell.Text;
         bl SHWGRID = new bl();
         GridView2.DataSource = SHWGRID.showgrid(ordno);
         GridView2.DataBind();
         GridView2.Enabled = true;
         GridView2.Visible = true;
         ScriptManager.RegisterStartupScript(Page, this.GetType(), "Key", "<script>MakeStaticHeader('" + SHWGRID.showgrid(ordno) + "', 400, 950 , 40 ,true); </script>", false);
     }
 }
Example #11
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            TextBox2.Text = "";
            TextBox3.Text = "";
            TextBox4.Text = "";

            TextBox2.Focus();
            TextBox6.Text = "";


            Calendar1.SelectedDate = DateTime.Today;


            bl refa = new bl();

            int refno = refa.refret();

            TextBox1.Text = refno.ToString();
        }
Example #12
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            TextBox2.Text = "";
            DropDownList6.SelectedItem.Value = "Meet Hours";
            TextBox4.Text = "";
            TextBox7.Text = "";
            TextBox2.Focus();
            TextBox6.Text     = "";
            CheckBox1.Checked = true;



            bl refa = new bl();

            try
            {
                int refno = refa.refret();
                TextBox1.Text = refno.ToString();
            }
            catch {
                TextBox1.Text = "";
            }
        }
Example #13
0
        public void TestMethod33()
        {
            // ToString test
            and and = new and(1, 2, 3);

            Assert.AreEqual("and r1 r2 r3", and.ToString());
            bne bne = new bne(1);

            Assert.AreEqual("bne 1", bne.ToString());
            bg bg = new bg(1);

            Assert.AreEqual("bg 1", bg.ToString());
            bl bl = new bl(1);

            Assert.AreEqual("bl 1", bl.ToString());
            bge_rt bge_rt = new bge_rt(1);

            Assert.AreEqual("bge_rt 1", bge_rt.ToString());
            ble_rt ble_rt = new ble_rt(1);

            Assert.AreEqual("ble_rt 1", ble_rt.ToString());
            cmp_i cmpi = new cmp_i(1, 2);

            Assert.AreEqual("cmp_i r1 r2", cmpi.ToString());
            cmp_f cmpf = new cmp_f(1, 2);

            Assert.AreEqual("cmp_f r1 r2", cmpf.ToString());
            cmp_v cmpv = new cmp_v(1, 2);

            Assert.AreEqual("cmp_v r1 r2", cmpv.ToString());
            ff_add ff_add = new ff_add(1, 2, 3);

            Assert.AreEqual("ff_add r1 r2 r3", ff_add.ToString());
            ff_sub ff_sub = new ff_sub(1, 2, 3);

            Assert.AreEqual("ff_sub r1 r2 r3", ff_sub.ToString());
            ff_mul ff_mul = new ff_mul(1, 2, 3);

            Assert.AreEqual("ff_mul r1 r2 r3", ff_mul.ToString());
            ff_div ff_div = new ff_div(1, 2, 3);

            Assert.AreEqual("ff_div r1 r2 r3", ff_div.ToString());
            fin fin = new fin();

            Assert.AreEqual("fin", fin.ToString());
            ftoi ftoi = new ftoi(1, 2);

            Assert.AreEqual("ftoi r1 r2", ftoi.ToString());
            ii_add ii_add = new ii_add(1, 2, 3);

            Assert.AreEqual("ii_add r1 r2 r3", ii_add.ToString());
            ii_addi ii_addi = new ii_addi(1, 2, 3);

            Assert.AreEqual("ii_addi r1 r2 3", ii_addi.ToString());
            ii_sub ii_sub = new ii_sub(1, 2, 3);

            Assert.AreEqual("ii_sub r1 r2 r3", ii_sub.ToString());
            ii_subi ii_subi = new ii_subi(1, 2, 3);

            Assert.AreEqual("ii_subi r1 r2 3", ii_subi.ToString());
            ii_mul ii_mul = new ii_mul(1, 2, 3);

            Assert.AreEqual("ii_mul r1 r2 r3", ii_mul.ToString());
            ii_muli ii_muli = new ii_muli(1, 2, 3);

            Assert.AreEqual("ii_muli r1 r2 3", ii_muli.ToString());
            ii_div ii_div = new ii_div(1, 2, 3);

            Assert.AreEqual("ii_div r1 r2 r3", ii_div.ToString());
            ii_divi ii_divi = new ii_divi(1, 2, 3);

            Assert.AreEqual("ii_divi r1 r2 3", ii_divi.ToString());
            itof itof = new itof(1, 2);

            Assert.AreEqual("itof r1 r2", itof.ToString());
            real_jmp real_jmp = new real_jmp(1);

            Assert.AreEqual("real_jmp 1", real_jmp.ToString());
            jmp_link jmp_link = new jmp_link(1);

            Assert.AreEqual("jmp_link 1", jmp_link.ToString());
            not not = new not(1, 2);

            Assert.AreEqual("not r1 r2", not.ToString());
            or or = new or(1, 2, 3);

            Assert.AreEqual("or r1 r2 r3", or.ToString());
            ret ret = new ret();

            Assert.AreEqual("ret", ret.ToString());
            s_get_from_v sgfv = new s_get_from_v(1, 2, 3);

            Assert.AreEqual("s_get_from_v r1 r2 3", sgfv.ToString());
            s_load_4byte sl4b = new s_load_4byte(1, 2, 3);

            Assert.AreEqual("s_load_4byte r1 r2 3", sl4b.ToString());
            s_store_4byte ss4b = new s_store_4byte(1, 2, 3);

            Assert.AreEqual("s_store_4byte r1 r2 3", ss4b.ToString());
            s_write_high swh = new s_write_high(1, 5);

            Assert.AreEqual("s_write_high r1 5", swh.ToString());
            s_write_low swl = new s_write_low(1, 5);

            Assert.AreEqual("s_write_low r1 5", swl.ToString());
            s_push s_push = new s_push(1);

            Assert.AreEqual("s_push r1", s_push.ToString());
            s_pop s_pop = new s_pop(1);

            Assert.AreEqual("s_pop r1", s_pop.ToString());
            v_push v_push = new v_push(1);

            Assert.AreEqual("v_push r1", v_push.ToString());
            v_pop v_pop = new v_pop(1);

            Assert.AreEqual("v_pop r1", v_pop.ToString());
            v_get_from_s vgfs = new v_get_from_s(1, 2, 3);

            Assert.AreEqual("v_get_from_s r1 r2 3", vgfs.ToString());
            v_load_16byte vl16 = new v_load_16byte(1, 2, 3);

            Assert.AreEqual("v_load_16byte r1 r2 3", vl16.ToString());
            v_magn v_magn = new v_magn(1, 2);

            Assert.AreEqual("v_magn r1 r2", v_magn.ToString());
            v_store_16byte vs16 = new v_store_16byte(1, 2, 3);

            Assert.AreEqual("v_store_16byte r1 r2 3", vs16.ToString());
            vf_add vf_add = new vf_add(1, 2, 3);

            Assert.AreEqual("vf_add r1 r2 r3", vf_add.ToString());
            vf_sub vf_sub = new vf_sub(1, 2, 3);

            Assert.AreEqual("vf_sub r1 r2 r3", vf_sub.ToString());
            vf_mul vf_mul = new vf_mul(1, 2, 3);

            Assert.AreEqual("vf_mul r1 r2 r3", vf_mul.ToString());
            vf_div vf_div = new vf_div(1, 2, 3);

            Assert.AreEqual("vf_div r1 r2 r3", vf_div.ToString());
            vi_add vi_add = new vi_add(1, 2, 3);

            Assert.AreEqual("vi_add r1 r2 r3", vi_add.ToString());
            vi_sub vi_sub = new vi_sub(1, 2, 3);

            Assert.AreEqual("vi_sub r1 r2 r3", vi_sub.ToString());
            vi_mul vi_mul = new vi_mul(1, 2, 3);

            Assert.AreEqual("vi_mul r1 r2 r3", vi_mul.ToString());
            vi_div vi_div = new vi_div(1, 2, 3);

            Assert.AreEqual("vi_div r1 r2 r3", vi_div.ToString());
            vv_add vv_add = new vv_add(1, 2, 3);

            Assert.AreEqual("vv_add r1 r2 r3", vv_add.ToString());
            vv_sub vv_sub = new vv_sub(1, 2, 3);

            Assert.AreEqual("vv_sub r1 r2 r3", vv_sub.ToString());
            vv_mul_ele vv_mul_ele = new vv_mul_ele(1, 2, 3);

            Assert.AreEqual("vv_mul_ele r1 r2 r3", vv_mul_ele.ToString());
            vv_mul_dot vv_mul_dot = new vv_mul_dot(1, 2, 3);

            Assert.AreEqual("vv_mul_dot r1 r2 r3", vv_mul_dot.ToString());
            vv_div vv_div = new vv_div(1, 2, 3);

            Assert.AreEqual("vv_div r1 r2 r3", vv_div.ToString());
            xor xor = new xor(1, 2, 3);

            Assert.AreEqual("xor r1 r2 r3", xor.ToString());
        }
Example #14
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            HttpContext.Current.Server.ScriptTimeout = 600;
            Server.ScriptTimeout = 500;
            bool flag = true;

            string confrim_value = Request.Form["Confirm_Value"];

            if (TextBox4.Text == "")
            {
                Response.Write("<script>alert('Problem Cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if (TextBox6.Text == "")
            {
                Response.Write("<script>alert('Received Date Cannot be Blank')</script>");
                TextBox6.Focus();
                flag = false;
            }

            if (TextBox7.Text == "")
            {
                Response.Write("<script>alert('Requestor Email Cannot be Blank</script>");
                TextBox7.Focus();
                flag = false;
            }

            if ((TextBox8.Text == "") && (TextBox9.Text == ""))
            {
                Response.Write("<script>alert('TimeEntries cannot be Blank')</script>");
                TextBox4.Focus();
                flag = false;
            }

            if ((confrim_value == "YES") && (flag == true) && (CheckBox1.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList5.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;
                bool     msgflag       = false;

                bl c = new bl();
                try
                {
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    stat    = c.addsrvreq1(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    msgflag = true;
                }


                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Couldnt Be Added Try Again')", true);
                }

                if (msgflag)
                {
                    Response.Write("<script>alert('Request Added Successfully');</script>");
                }

                //if (Com_Type != "CONFIGMGMT")

                //{
                //    //email to buswani
                //    string email = "*****@*****.**";
                //    System.Net.Mail.MailMessage message3 = new System.Net.Mail.MailMessage();
                //    message3.To.Add(email);
                //    message3.Subject = "Mail from IT Help Desk";
                //    message3.From = new System.Net.Mail.MailAddress("*****@*****.**");
                //    message3.Body = "Dear       : Mr. Buswani  "
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "IT Request Received from :   " + Req_Name + "    on this Date   :" + System.DateTime.Today.ToShortDateString()
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "Category         :  " + Type +
                //    Environment.NewLine
                //    + "Reference No     :  " + Ref_No +
                //    Environment.NewLine +
                //    "Problem Desc      :  " + Prob_Desc
                //    + Environment.NewLine
                //    + Environment.NewLine
                //    + "Thank you."
                //    + Environment.NewLine
                //    + "Regards"
                //    + Environment.NewLine
                //    + "AeroLogica Sdn Bhd  "
                //    + Environment.NewLine
                //    + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                //    System.Net.Mail.SmtpClient smtp3 = new System.Net.Mail.SmtpClient("128.2.11.11");
                //    smtp3.Port = 25;

                //    smtp3.Send(message3);
                //    //end of buswani mail message
                //}

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No         :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Service Request Type :  " + khidmat2 +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name          :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by               :  " + Req_Name +
                               Environment.NewLine
                               + "on this date          :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is   :  " + Type +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    Response.Write("<script>alert('Email Sent Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent Successfully')", true);
                }


                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent ')", true);
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;

                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script>alert('Email sent Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent Successfully')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent')", true);
                }

                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;

                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;

                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;
                //}
            }


// EMAIL NO 2

            if (((confrim_value == "YES") && (flag == true)) && (CheckBox2.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList7.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;

                bl c = new bl();
                try
                {
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Couldnt Be Added Try Again')", true);
                }

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No        :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name        :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by             :  " + Req_Name +
                               Environment.NewLine
                               + "on this date        :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is :  " + Type +
                               Environment.NewLine
                               + "Please Note that this Problem is also CC to         :  " + DropDownList5.Text + "         " + "        " + DropDownList8.Text +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    Response.Write("<script>alert('Email sent to Assignee Person');</script>");
                }
                catch
                {
                    Response.Write("<script>alert('Email Couldnt be sent');</script>");
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;

                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script> alert('Email sent to Requestor');</script>");
                }
                catch
                {
                    Response.Write("<script> alert('Email Couldnt be sent');</script>");
                }


                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
            }
// EMAIL NO 3
            if (((confrim_value == "YES") && (flag == true)) && (CheckBox3.Checked == true))
            {
                int      Ref_No = Int32.Parse(TextBox1.Text);
                DateTime rec_da = System.DateTime.Now;
                if ((TextBox8.Text == "") || (TextBox9.Text == ""))
                {
                    TextBox8.Text = "00";
                    TextBox9.Text = "00";
                }
                string condate  = TextBox6.Text + " " + TextBox8.Text + ":" + TextBox9.Text + ":" + "00";
                string Rec_Date = Convert.ToDateTime(condate).ToString("yyyy/MM/dd HH:mm:ss");

                string   Prob_Desc     = TextBox4.Text;
                string   Type          = DropDownList2.SelectedItem.Text;
                string   Remarks       = DropDownList6.SelectedItem.Value;
                string   Req_Name      = TextBox2.Text;
                string   Com_Type      = DropDownList3.SelectedItem.Text;
                string   Req_Email     = TextBox7.Text;
                string   Req_Status    = DropDownList4.SelectedItem.Text;
                string   Act_Email     = DropDownList8.SelectedItem.Text;
                string   khidmat2      = ddlType.SelectedItem.Text;
                DateTime Escalate_Date = DateTime.Now;


                bl c = new bl();
                try
                {
                    HttpContext.Current.Server.ScriptTimeout = 900000;
                    bool stat = c.addsrvreq(Ref_No, Rec_Date, Req_Name, Prob_Desc, Type, Com_Type, Req_Email, Req_Status, Remarks, Act_Email, khidmat2, Escalate_Date);
                    Response.Write("<script>alert('Request Added Successfully');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Added Successfully')", true);
                }
                catch
                {
                    Response.Write("<script>alert('Request NOT Added TRY AGAIN');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Request Not Added Try Again')", true);
                }

                //Response.Cookies[cookname] ["date"]  =Convert.ToString(System.DateTime.Now);
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add(Act_Email);
                message.Subject = "Mail from IT Help Desk";
                message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                if (g.fileName != "")
                {
                    System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(Server.MapPath((@"~/" + g.fileName)));
                    message.Attachments.Add(attach);
                }

                message.Body = "Problem Description :  " + Prob_Desc +
                               Environment.NewLine
                               + "Reference No        :  " + Ref_No +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Company Name        :  " + Com_Type +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Sent by             :  " + Req_Name +
                               Environment.NewLine
                               + "on this date        :  " + Rec_Date +
                               Environment.NewLine
                               + "Priority Rating is :  " + Type +
                               Environment.NewLine
                               + "Please Attend to this Problem and Submit Request through Request Application Processing Software as soon as possible" +
                               Environment.NewLine
                               + "Please Note that this Problem is also Forwarded to  :  " + DropDownList5.Text + " and  " + DropDownList7.Text +
                               Environment.NewLine
                               + Environment.NewLine
                               + "Thank you."
                               + Environment.NewLine
                               + "Regards" +
                               Environment.NewLine
                               + Environment.NewLine
                               + "AeroLogica Sdn Bhd  " +
                               Environment.NewLine
                               + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp.Port = 25;
                try
                {
                    smtp.Send(message);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent To Problem Solver')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Couldnt be Sent Try Again')", true);
                }


                System.Net.Mail.MailMessage message2 = new System.Net.Mail.MailMessage();
                message2.To.Add(Req_Email);
                message2.Subject = "Mail from IT Help Desk";
                message2.From    = new System.Net.Mail.MailAddress("*****@*****.**");

                message2.Body = "Dear       :  " + Req_Name
                                + Environment.NewLine
                                + Environment.NewLine
                                + "We acknowledge receipt of your request.Your issue has now been prioritised, and our staff has been assigned to work on it. We will update this service request with further information, as we continue to work on the request."
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Category         :  " + Type +
                                Environment.NewLine
                                + "Reference No     :  " + Ref_No +
                                Environment.NewLine +
                                "Problem Desc      :  " + Prob_Desc
                                + Environment.NewLine
                                + Environment.NewLine
                                + "Thank you."
                                + Environment.NewLine
                                + "Regards"
                                + Environment.NewLine
                                + "AeroLogica Sdn Bhd  "
                                + Environment.NewLine
                                + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                System.Net.Mail.SmtpClient smtp2 = new System.Net.Mail.SmtpClient("128.2.11.11");
                smtp2.Port = 25;



                try
                {
                    smtp2.Send(message2);
                    Response.Write("<script>alert('Email sent to Requestor');</script>");
                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Sent To Requestor')", true);
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript", "alert('Email Coulnt Be Sent Try Again')", true);
                }


                //if (Type == "Urgent")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 14400000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}

                //if (Type == "Priority")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;
                //    Session["interval"] = 28800000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
                //if (Type == "Normal")
                //{
                //    DateTime valdate = Convert.ToDateTime(Request.Cookies[cookname].Value);
                //    Session["valdate"] = valdate;

                //    Session["interval"] = 129600000;
                //    Session["Act_Email"] = Act_Email;
                //    Session["Ref_No"] = Ref_No;
                //    Session["Prob_Desc"] = Prob_Desc;
                //    Session["Req_Name"] = Req_Name;


                //}
            }
            Server.Transfer("AddReq.aspx");
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TextBox7.Text = DateTime.Today.ToShortDateString();
                //TextBox7.Enabled = false;
                bl mod = new bl();

                int refno = 1;

                MySqlDataReader dd = null;

                try
                {
                    dd            = mod.modreq(refno);
                    TextB.Text    = dd.GetString("Req_Name");
                    TextBox5.Text = dd.GetString("Prob_Desc");
                    TextBox6.Text = dd.GetDateTime("Rec_Date").ToString("dd/MM/yyyy");
                    acttak.Text   = dd.GetString("Action");
                    //TextBox14 .Text  = dd.GetString("Act_date");
                    string comtype = dd.GetString("Com_Type");
                    string airod   = "AIROD";
                    string nadi    = "NADI";
                    string ae      = "AIROD AEROSPACE TECHNOLOGY";
                    string at      = "AIROD TECHNO POWER";
                    string ina     = "INAYAH";
                    string adc     = "AVIATION DESIGN CENTRE";
                    string al      = "AEROLOGICA";

                    if (string.Compare(comtype, airod) == 0)
                    {
                        DropDownList3.SelectedValue = "AIROD";
                    }
                    if (string.Compare(comtype, airod) == 0)
                    {
                        DropDownList3.SelectedIndex = 0;
                    }
                    if (string.Compare(comtype, nadi) == 0)
                    {
                        DropDownList3.SelectedIndex = 1;
                    }
                    if (string.Compare(comtype, ae) == 0)
                    {
                        DropDownList3.SelectedIndex = 3;
                    }
                    if (string.Compare(comtype, at) == 0)
                    {
                        DropDownList3.SelectedIndex = 4;
                    }
                    if (string.Compare(comtype, ina) == 0)
                    {
                        DropDownList3.SelectedIndex = 2;
                    }
                    if (string.Compare(comtype, adc) == 0)
                    {
                        DropDownList3.SelectedIndex = 5;
                    }
                    if (string.Compare(comtype, al) == 0)
                    {
                        DropDownList3.SelectedIndex = 6;
                    }
                    if (dd["Req_Email"] != System.DBNull.Value)
                    {
                        TextBox9.Text = dd.GetString("Req_Email");
                    }
                    if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "FARZLAN";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "AFRAH";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "NABHAN";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "KHAIRIL";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "FAWWAZ";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "KUAN";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "";
                    }
                    else if (dd["Act_Email"] == "*****@*****.**")
                    {
                        DropDownList2.SelectedValue = "KHALID";
                    }
                }

                catch
                {
                    dd = null;
                }
            }
        }
Example #16
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            var hold = Request.Form["confirm_value"];

            if (hold == "YES")
            {
                bl del = new bl();


                int Ref_No;
                HttpContext.Current.Server.ScriptTimeout = 9000;
                Server.ScriptTimeout = 900;

                Ref_No = Convert.ToInt32(DropDownList1.SelectedItem.Text);
                bool flag = del.delre(Ref_No);

                if (flag)
                {
                    Response.Write("<script>alert('Deleted Successfully');</script>");
                    SqlDataSource1.SelectCommand = "SELECT * FROM tbl_srvmast";
                    SqlDataSource1.DataBind();
                    SqlDataSource2.SelectCommand = "SELECT * FROM tbl_srvmast";
                    SqlDataSource2.DataBind();
                    GridView1.DataBind();
                    DropDownList1.SelectedIndex = 0;
                }
                else
                {
                    Response.Write("<script>alert ('Delete Unsuccessfull');</script>");
                }

                //int count = GridView1.Rows.Count;


                //database Helper
                //foreach( GridViewRow row in GridView1.Rows)
                //{


                //    var chk = row.FindControl("checkbox1") as CheckBox;
                //    if (chk != null)
                //    {
                //        if (chk.Checked == true)
                //        {
                //            int refnohold = int.Parse(row.Cells[1].Text);
                //            if (refnohold == 1) {
                //                Response.Write("<script> alert(' You cannot delete the First Record');</script>");
                //                Server.Transfer("ViewReq.aspx");
                //            }
                //            try
                //            {
                //                bool flag = del.delre(refnohold);
                //                chk = null;

                //                Response.Write("<script>alert('Deleted Successfully');</script>");
                //                GridView1.DataBind();
                //                DropDownList1.SelectedIndex = 0;
                //            }
                //            catch
                //            {


                //                Response.Write("<script>alert ('Delete Unsuccessfull');</script>");
                //            }



                //        }
                //    }

                //}
            }
        }
Example #17
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            HttpContext.Current.Server.ScriptTimeout = 900000;
            string val = Request.Form["confirm_value"];
            //string val1=string.Empty;
            //string jsScript = "";
            //jsScript += "var answer=confirm(\'Action Already Taken do you want to modify?\');\n";
            //jsScript += "if(answer){\n";
            //jsScript += "'" + val1 + "'='YES'}\n";

            bl mod = new bl();

            int refno = int.Parse(DropDownList1.SelectedItem.Text);

            MySqlDataReader dd = null;

            dd = mod.modreq(refno);

            if (val == "YES")
            {
                if (acttak != null)
                {
                }
                bl  upd    = new bl();
                int Ref_No = int.Parse(DropDownList1.SelectedItem.Text);

                string Req_Name  = TextB.Text;
                string Com_Type  = DropDownList3.SelectedItem.Text;
                string Prob_Desc = TextBox5.Text;
                string Rec_Date  = null;
                //string Rec_Date = Convert.ToDateTime(TextBox6.Text).ToString("yyyy/MM/dd hh:mm:ss");


                if ((TextBox12.Text == "") || (TextBox13.Text == ""))
                {
                    string Rec_Date1 = Convert.ToDateTime(TextBox6.Text).ToShortDateString() + " " + "00" + ":" + "00";
                    Rec_Date = Convert.ToDateTime(Rec_Date1).ToString("yyyy/MM/dd hh:mm:ss");
                }
                else
                {
                    string Rec_Date1 = Convert.ToDateTime(TextBox6.Text).ToShortDateString() + " " + TextBox12.Text + ":" + TextBox13.Text;
                    Rec_Date = Convert.ToDateTime(Rec_Date1).ToString("yyyy/MM/dd hh:mm:ss");
                }

                string Req_Email  = TextBox9.Text;
                string Action     = acttak.Text;
                string Action_By  = DropDownList2.SelectedItem.Text;
                string Remarks    = DropDownList5.SelectedItem.Value;                                  //select manual for REMARKS and save data in "tbl_srvmast"
                string Com_Date   = Convert.ToDateTime(TextBox7.Text).ToString("yyyy/MM/dd hh:mm:ss"); //select manual by user and save data in "tbl_srvmast"
                string Req_Status = DropDownList4.SelectedItem.Text;
                float  Req_Times  = Convert.ToInt32(TextBox11.Text);
                string servType   = ddlType.SelectedItem.Text;

                DateTime Com_Dates = DateTime.Now; //complete date save in tbl_srvmast1 only
                DateTime escalate;

                //to calculate escalate time
                if (dd["Escalate_Date"].ToString() == "".Trim())
                {
                    escalate       = DateTime.Now;
                    TextBox14.Text = escalate.ToString();
                }
                else
                {
                    escalate = Convert.ToDateTime(dd["Escalate_Date"]);
                }

                DateTime date_now = DateTime.Now;

                //Automation REMARK for bos only and save in TABLE "tbl_srvmast1"
                string Type   = dd.GetString("Type");
                string Remark = "";
                double d      = double.Parse(TextBox11.Text); //time comparison

                if (Type == "Normal")
                {
                    if ((d >= 0.00) && (d <= 38.00))
                    {
                        Remark = "Meet Hours";
                    }
                    else
                    {
                        Remark = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }

                if (Type == "Priority")
                {
                    if ((d >= 0.00) && (d <= 8.00))
                    {
                        Remark = "Meet Hours";
                    }
                    else
                    {
                        Remark = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }
                if (Type == "Urgent")
                {
                    if ((d >= 0.00) && (d <= 4.00))
                    {
                        Remark = "Meet Hours";
                    }
                    else
                    {
                        Remark = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }
                //end calculation
                bool stat = false;
                try
                {
                    HttpContext.Current.Server.ScriptTimeout = 9000;
                    Server.ScriptTimeout = 900;

                    stat = upd.updreq(Ref_No, Req_Name, Com_Type, Prob_Desc, Rec_Date, Req_Email, Req_Status, Action, Action_By, Com_Date, Remarks, Req_Times, servType);  //table for audit reference
                    stat = upd.updreq1(Ref_No, Req_Name, Com_Type, Prob_Desc, Rec_Date, Req_Email, Req_Status, Action, Action_By, Com_Dates, Remark, Req_Times, servType); //table for BUSWANI reference


                    if (stat)
                    {
                        Response.Write("<script>alert('UPDATED SUCCESSFULLY');</script>");
                        //ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "myscript", "alert('MODIFIED SUCCESSFULLY')", true);
                        string formattedcomdate             = Convert.ToDateTime(Com_Date).ToShortDateString();
                        System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                        message.To.Add(Req_Email);
                        message.Subject = "Mail from Aerologica Service Team";
                        message.From    = new System.Net.Mail.MailAddress("*****@*****.**");
                        message.Body    = "Respected   :     " + Req_Name +
                                          Environment.NewLine
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "Type of Service Request:   " + servType
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "Your Problem Description:  " + Prob_Desc + "   has now been solved."
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "Action Description : " + Action
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "Action Taken By Aerologica IT Personnel: " + Action_By
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "on this date : " + formattedcomdate
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + Environment.NewLine
                                          + "Thank you."
                                          + Environment.NewLine
                                          + "AeroLogica Sdn Bhd"
                                          + Environment.NewLine
                                          + "Tel No: 03 -7846 5112    Ext No: 273 / 314 /317  ";
                        System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("128.2.11.11");
                        smtp.Port = 25;

                        try
                        {
                            Response.Write("<script>alert('Email sent to Requestor Successfully');</script>");
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript1", "alert('Email Sent Successfully')", true);
                            smtp.Send(message);
                        }
                        catch
                        {
                            Response.Write("<script>alert('Email COULDNT BE sent to Requestor');</script>");
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myscript2", "alert('Email Couldnt be Sent')", true);
                        }
                    }
                }
                catch
                {
                    Response.Write("<script>alert('COULDNT UPDATE THE RECORD TRY AGAIN');</script>");
                    stat = false;
                }
            }
        }
Example #18
0
        protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        {
            HttpContext.Current.Server.ScriptTimeout = 900000;
            acttak.Text    = "";
            TextB.Text     = "";
            TextBox5.Text  = "";
            TextBox6.Text  = "";
            TextBox7.Text  = "";
            TextBox12.Text = "00";
            TextBox13.Text = "00";
            DropDownList1.Focus();
            DropDownList1.SelectedIndex = 0;

            bl mod = new bl();

            int refno = 1;

            MySqlDataReader dd = null;

            try
            {
                dd = mod.modreq(refno);
                if (dd["Action"] != System.DBNull.Value)
                {
                    acttak.Text = dd.GetString("Action");
                }
                TextB.Text    = dd.GetString("Req_Name");
                TextBox5.Text = dd.GetString("Prob_Desc");
                TextBox6.Text = dd.GetDateTime("Rec_Date").ToString("dd/MM/yyyy");
                DropDownList4.SelectedItem.Text = dd.GetString("Req_Status");
                TextBox11.Text = "";
                if (dd["Req_Email"] != System.DBNull.Value)
                {
                    TextBox9.Text = dd.GetString("Req_Email");
                }
                else
                {
                    TextBox9.Text = "";
                }

                string comtype = dd.GetString("Com_Type");
                string airod   = "AIROD";
                string nadi    = "NADI";
                string ae      = "AIROD AEROSPACE TECHNOLOGY";
                string at      = "AIROD TECHNO POWER";
                string ina     = "INAYAH";
                string adc     = "AVIATION DESIGN CENTRE";
                string al      = "AEROLOGICA";

                if (string.Compare(comtype, airod) == 0)
                {
                    DropDownList3.SelectedIndex = 0;
                }
                if (string.Compare(comtype, nadi) == 0)
                {
                    DropDownList3.SelectedIndex = 1;
                }
                if (string.Compare(comtype, adc) == 0)
                {
                    DropDownList3.SelectedIndex = 5;
                }
                if (string.Compare(comtype, ae) == 0)
                {
                    DropDownList3.SelectedIndex = 3;
                }
                if (string.Compare(comtype, at) == 0)
                {
                    DropDownList3.SelectedIndex = 4;
                }
                if (string.Compare(comtype, ina) == 0)
                {
                    DropDownList3.SelectedIndex = 2;
                }
                if (string.Compare(comtype, al) == 0)
                {
                    DropDownList3.SelectedIndex = 6;
                }
            }
            catch
            {
                dd = null;
            }
        }
Example #19
0
        protected void DropDownList1_TextChanged(object sender, EventArgs e)
        {
            bl mod = new bl();

            int refno = int.Parse(DropDownList1.SelectedItem.Text);

            MySqlDataReader dd = null;

            try
            {
                dd               = mod.modreq(refno);
                acttak.Text      = "";
                TextB.Text       = dd.GetString("Req_Name");
                TextBox5.Text    = dd.GetString("Prob_Desc");
                TextBox6.Text    = dd.GetDateTime("Rec_Date").ToString("dd/MM/yyyy");
                TextBox6.Enabled = false;
                if (dd["Req_Status"] != System.DBNull.Value)
                {
                    DropDownList4.SelectedItem.Text = dd.GetString("Req_Status");
                }
                //if (dd["Remarks"] != System.DBNull.Value)
                //{

                //    DropDownList5.SelectedValue = dd.GetString("Remarks");
                //}

                if (dd["Action"] != System.DBNull.Value)
                {
                    acttak.Text = dd.GetString("Action");
                }

                string comtype = string.Empty;
                if (dd["Com_Type"] != System.DBNull.Value)
                {
                    comtype = dd.GetString("Com_Type");
                }

                //To calculate escalate time
                DateTime escalate;
                if (TextBox14.Text == "")
                {
                    escalate       = DateTime.Now;
                    TextBox14.Text = escalate.ToString();
                }
                else
                {
                    escalate = Convert.ToDateTime(dd["Escalate_Date"]);
                }

                DateTime date_now = DateTime.Now;
                int      count    = 0;

                if (TextBox11.Text == "".Trim()) //If no value or data
                {
                    for (var i = escalate; i < date_now; i = i.AddHours(1))
                    {
                        if (i.DayOfWeek != DayOfWeek.Saturday && i.DayOfWeek != DayOfWeek.Sunday)
                        {
                            if (i.TimeOfDay.Hours >= 8 && i.TimeOfDay.Hours < 16)
                            {
                                count++;
                            }
                        }
                    }
                    TextBox11.Text = count.ToString();
                }
                else
                {
                    TextBox11.Text = "";
                    TextBox11.Text = dd.GetString("Req_Time"); //Data from DB
                }
                //end calculation


                string airod = "AIROD";
                string nadi  = "NADI";
                string ae    = "AIROD AEROSPACE TECHNOLOGY";
                string at    = "AIROD TECHNO POWER";
                string cm    = "CONFIGMGMT";
                string ina   = "INAYAH";
                string adc   = "AVIATION DESIGN CENTRE";
                string al    = "AEROLOGICA";

                if (dd["Req_Status"] != System.DBNull.Value)
                {
                    DropDownList4.SelectedValue = dd.GetString("Req_Status");
                }

                if (string.Compare(comtype, airod) == 0)
                {
                    DropDownList3.SelectedValue = "AIROD";
                }
                if (string.Compare(comtype, cm) == 0)
                {
                    DropDownList3.SelectedValue = "CONFIGMGMT";
                }
                if (string.Compare(comtype, airod) == 0)
                {
                    DropDownList3.SelectedIndex = 0;
                }
                if (string.Compare(comtype, nadi) == 0)
                {
                    DropDownList3.SelectedIndex = 1;
                }
                if (string.Compare(comtype, ae) == 0)
                {
                    DropDownList3.SelectedIndex = 3;
                }
                if (string.Compare(comtype, at) == 0)
                {
                    DropDownList3.SelectedIndex = 4;
                }
                if (string.Compare(comtype, ina) == 0)
                {
                    DropDownList3.SelectedIndex = 2;
                }
                if (string.Compare(comtype, adc) == 0)
                {
                    DropDownList3.SelectedIndex = 5;
                }
                if (string.Compare(comtype, al) == 0)
                {
                    DropDownList3.SelectedIndex = 6;
                }

                string actemail = dd["Act_Email"].ToString();

                if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FARZLAN";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "AFRAH";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "NABHAN";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KHAIRIL";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FAWWAZ";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KUAN";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KHALID";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FARISYA";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "REDZUAN";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KAMISAH";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "HASLINDA";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "SHAMIL";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "ROZAIDI";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "AFIQ";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "SUHAILA";
                }
                else if (actemail == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "IKRAM";
                }
            }
            catch
            {
                dd = null;
            }
        }
Example #20
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            bl mod = new bl();

            int refno = int.Parse(DropDownList1.SelectedItem.Text);

            MySqlDataReader dd = null;

            try
            {
                dd = mod.modreq(refno);
                if (dd["Req_Status"] != System.DBNull.Value)
                {
                    DropDownList4.SelectedValue = dd.GetString("Req_Status");
                }

                if (dd["ServiceType"] != System.DBNull.Value)
                {
                    ddlType.SelectedValue = dd.GetString("ServiceType");
                }
                //if (dd["Remarks"] != System.DBNull.Value)
                //{

                //    //DropDownList5.SelectedValue = dd.GetString("Remarks");
                //}

                if (dd["Action"] != System.DBNull.Value)
                {
                    acttak.Text = dd.GetString("Action");
                }
                TextB.Text    = dd.GetString("Req_Name");
                TextBox5.Text = dd.GetString("Prob_Desc");
                if (dd["Req_Time"] != System.DBNull.Value)
                {
                    TextBox11.Text = dd.GetInt16("Req_Time").ToString();
                }
                if (dd["Req_Email"] != System.DBNull.Value)
                {
                    TextBox9.Text = dd.GetString("Req_Email");
                }
                else
                {
                    TextBox9.Text = "";
                }
                string comtype = string.Empty;
                if (dd["Com_Type"] != System.DBNull.Value)
                {
                    comtype = dd.GetString("Com_Type");
                }
                DateTime hours = Convert.ToDateTime(dd["Rec_Date"]);

                if ((hours) != null)
                {
                    TextBox12.Text = Convert.ToString((hours).Hour);
                    TextBox13.Text = Convert.ToString((hours).Minute);
                }

                TextBox14.Text = dd.GetString("Escalate_Date");

                //To calculate escalate time
                DateTime escalate = Convert.ToDateTime(dd["Escalate_Date"]);
                string   a        = dd.GetString("Escalate_Date");
                DateTime date_now = DateTime.Now;
                string   total;

                if (TextBox11.Text == null) //If no value or data
                {
                    TimeSpan diff        = date_now - escalate;
                    double   diffInHours = diff.TotalHours;
                    //TextBox11.Text = diff.ToString(@"hh\.mm");
                    //total = String.Format("{0:0.00}", diff.TotalMinutes);
                    //total = String.Format("{0:00}:{1:00}:{2:00}", diff.Hours, diff.Minutes, diff.Seconds);
                    //total = String.Format("{0} days, {1} hours, {2} minutes,", diff.Days, diff.Hours, diff.Minutes);
                    //TextBox11.Text = diff.ToString("hh:mm");
                    TextBox11.Text = diffInHours.ToString("0");
                }

                else
                {
                    TextBox11.Text = "";
                    TextBox11.Text = dd.GetString("Req_Time"); //Data from DB
                }
                //end calculation
                //From Req_Time -  Meet Hours OR Not Meet Hours
                string Type    = dd.GetString("Type");
                string Remarks = "";
                double d       = double.Parse(TextBox11.Text);

                if (Type == "Normal")
                {
                    if ((d >= 0.00) && (d <= 38.00))
                    {
                        Remarks = "Meet Hours";
                    }
                    else
                    {
                        Remarks = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }
                if (Type == "Priority")
                {
                    if ((d >= 0.00) && (d <= 8.00))
                    {
                        Remarks = "Meet Hours";
                    }
                    else
                    {
                        Remarks = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }
                if (Type == "Urgent")
                {
                    if ((d >= 0.00) && (d <= 4.00))
                    {
                        Remarks = "Meet Hours";
                    }
                    else
                    {
                        Remarks = "Not Meet Hours";
                    }
                    //TextBox7.Text = Type + "" + Remarks;
                }

                //end calculation
                string airod = "AIROD";
                string nadi  = "NADI";
                string ae    = "AIROD AEROSPACE TECHNOLOGY";
                string at    = "AIROD TECHNO POWER";
                string cm    = "CONGIMGMT";
                string ina   = "INAYAH";
                string adc   = "AVIATION DESIGN CENTRE";
                string al    = "AEROLOGICA";

                if (string.Compare(comtype, airod) == 0)
                {
                    DropDownList3.SelectedValue = "AIROD";
                }
                if (string.Compare(comtype, cm) == 0)
                {
                    DropDownList3.SelectedValue = "CONFIGMGMT";
                }
                if (string.Compare(comtype, airod) == 0)
                {
                    DropDownList3.SelectedIndex = 0;
                }
                if (string.Compare(comtype, nadi) == 0)
                {
                    DropDownList3.SelectedIndex = 1;
                }
                if (string.Compare(comtype, ae) == 0)
                {
                    DropDownList3.SelectedIndex = 3;
                }
                if (string.Compare(comtype, at) == 0)
                {
                    DropDownList3.SelectedIndex = 4;
                }
                if (string.Compare(comtype, ina) == 0)
                {
                    DropDownList3.SelectedIndex = 2;
                }
                if (string.Compare(comtype, adc) == 0)
                {
                    DropDownList3.SelectedIndex = 5;
                }
                if (string.Compare(comtype, al) == 0)
                {
                    DropDownList3.SelectedIndex = 6;
                }

                if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FARZLAN";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "AFRAH";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "NABHAN";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KHAIRIL";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FAWWAZ";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KUAN";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KHALID";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "FARISYA";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "REDZUAN";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "KAMISAH";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "HASLINDA";
                }
                else if (dd["Act_Email"] == "*****@*****.**")
                {
                    DropDownList2.SelectedValue = "SHAMIL";
                }
            }
            catch { dd = null; }
        }