using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CheckSheet.setting
{
    public partial class Register_equipment_delete : System.Web.UI.Page
    {

       
        [System.Web.Services.WebMethod]
        public static string sendmail(string parahd)
        {

            byte[] datahd = System.Convert.FromBase64String(parahd);
            string base64Decoded = System.Text.ASCIIEncoding.UTF8.GetString(datahd);
            string[] strmt = base64Decoded.Split('|');
            try
            {
                string linegroup = strmt[0].ToString();
                string linename = strmt[1].ToString();
                string machineid = strmt[2].ToString();
                string machinename = strmt[3].ToString();
                machinename = machinename.Replace("&amp;", "&");
                string partnumber = strmt[4].ToString();
                string notice = strmt[5].ToString();
                string lamp = strmt[6].ToString();
                string model = strmt[7].ToString();


                string detail = "Factory (LAMP) : " + lamp + "<br/>";
                detail = detail + "Line group id : " + linegroup + "<br/>";
                detail = detail + "Line group name : " + linename + "<br/>";
                detail = detail + "Model : " + model + "<br/>";
                detail = detail + "Machine id : " + machineid + "<br/>";
                detail = detail + "Machine name : " + machinename + "<br/>";
                detail = detail + "Partnumber : " + partnumber + "<br/>";
                detail = detail + "Notice : " + notice;


                try
                {
                    string userapprove = clsControlUI.getuserapprove("2", "1", partnumber);
                    clsControlUI.sendemail_delete_linegroup(linegroup, partnumber, machineid, detail, "Check sheet document waiting for approval.", userapprove);
                }
                catch { };
            }
            catch { }
            return "";

        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnback_Click(object sender, EventArgs e)
        {
            Response.Redirect("RegisterEquipment");
        }
    }
}