示例#1
0
 public void AddEvent(eventAdmin objeventman)
 {
     try
     {
         AdminDAL objAdminDAL = new AdminDAL();
         objAdminDAL.AddEvent(objeventman);
     }
     catch (Exception es)
     {
         throw es;
     }
 }
示例#2
0
        public void Updatevent(eventAdmin objevent)
        {
            try
            {
                AdminDAL objAdminDAL = new AdminDAL();
                objAdminDAL.Updateevent(objevent);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        protected void btnAdd1_Click(object sender, EventArgs e)
        {
            AddNewEventmanRequest objAddEventmanRequest = new AddNewEventmanRequest();
            eventAdmin            objeventman           = new eventAdmin();
            DateTime datetime;

            objeventman.date       = DateTime.TryParse(txtFromDate.Text, out datetime) ? (DateTime?)datetime : null;;
            objeventman.time       = DateTime.TryParse(txtFromDate1.Text, out datetime) ? (DateTime?)datetime : null;;
            objeventman.location   = txtLocation1.Text;
            objeventman.eventbreaf = txtEventBreaf1.Text;

            AdminBLL ws = new AdminBLL();

            ws.AddEvent(objeventman);
            HttpContext.Current.Items.Add("COMPLETE", "INSERT");
            Server.Transfer("..//SMSADMIN//AddNewEventComplete.aspx");
        }
示例#4
0
        protected void cmdbuttonadd_Click(object sender, EventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AddNewEventmanRequest objAddEventmanRequest = new AddNewEventmanRequest();
                eventAdmin            objeventman           = new eventAdmin();
                DateTime datetime;
                if (txtNricNo.Text.Trim() != "" && txtname.Text.Trim() != "")
                {
                    objeventman.Date_From = DateTime.TryParse(txtFromDate.Text, out datetime) ? (DateTime?)datetime : null;
                    objeventman.Date_to   = DateTime.TryParse(txttoDate.Text, out datetime) ? (DateTime?)datetime : null;

                    objeventman.Event_Type = drlEventType.Text.Trim();
                    objeventman.Start_time = TimeSelector1.Date.TimeOfDay.ToString();
                    objeventman.End_time   = TimeSelector2.Date.TimeOfDay.ToString();

                    objeventman.Special_Requirment = txtspecialreq.Text;
                    objeventman.Guard_Requirment   = txtgaurdreq.Text;
                    objeventman.Special_Duty       = txtdutygaurd.Text;
                    objeventman.Incharg_Name       = txtname.Text.Trim();
                    objeventman.Incharg_NricNo     = txtNricNo.Text.Trim();
                    objeventman.Incharg_position   = txtPosition.Text;
                    objeventman.Incharg_ContactNo  = txtContact.Text;
                    objeventman.Superior_Name      = txtSupireorName.Text;
                    string location_id = getLocationIDByName1(drlLocation.SelectedValue.ToString());
                    objeventman.Location_id = location_id;

                    AdminBLL ws = new AdminBLL();
                    ws.AddEvent(objeventman);

                    HttpContext.Current.Items.Add("COMPLETE", "INSERT");
                    Server.Transfer("..//SMSADMIN//AlertUpdateComplete.aspx");
                }
                else
                {
                    lblerror.Visible = true;
                    lblerror.Text    = "Please Fill NRICno. & Name.....!";
                }
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
示例#5
0
        protected void cmdbuttonadd_Click(object sender, EventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                eventAdmin objevent = new eventAdmin();
                AdminBLL   ws       = new AdminBLL();
                DateTime   datetime;

                objevent.Event_ID  = txtEventID.Text;
                objevent.Date_From = DateTime.TryParse(txtFromDate.Text, out datetime) ? (DateTime?)datetime : null;;
                objevent.Date_to   = DateTime.TryParse(txttoDate.Text, out datetime) ? (DateTime?)datetime : null;;

                objevent.Location_id = Convert.ToString(GetLocationIDbyName(drlLocation.Text));
                objevent.Event_Type  = drlEventType.Text;
                string time = TimeSelector1.Date.TimeOfDay.ToString();
                objevent.Start_time = time;
                string time1 = TimeSelector2.Date.TimeOfDay.ToString();
                objevent.End_time = time1;

                objevent.Special_Requirment = txtspecialreq.Text;
                objevent.Guard_Requirment   = txtgaurdreq.Text;
                objevent.Special_Duty       = txtdutygaurd.Text;
                objevent.Incharg_Name       = txtname.Text;
                objevent.Incharg_NricNo     = txtNricNo.Text;
                objevent.Incharg_position   = txtPosition.Text;
                objevent.Incharg_ContactNo  = txtContact.Text;
                objevent.Superior_Name      = txtSupireorName.Text;


                ws.Updatevent(objevent);
                HttpContext.Current.Items.Add(ContextKeys.CTX_COMPLETE, "UPDATE");
                Server.Transfer("AlertUpdateComplete.aspx");
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
示例#6
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                if (ViewState["Event_ID"] != null)
                {
                    eventAdmin objevent = new eventAdmin();
                    AdminBLL   ws       = new AdminBLL();
                    DateTime   datetime;

                    objevent.Event_ID = txtEventID.Text;
                    // objevent.Date_From = DateTime.TryParse(txtFromDateUpdate.Text, out datetime) ? (DateTime?)datetime : null; ;
                    // objevent.Date_to = DateTime.TryParse(ToDateUpdate.Text, out datetime) ? (DateTime?)datetime : null; ;
                    if (txtFromDateUpdate.Text.Length == 0)
                    {
                        objevent.Date_From = null;
                    }
                    else
                    {
                        DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
                        dtfi.ShortDatePattern = "MM/dd/yyyy";
                        dtfi.DateSeparator    = "/";
                        DateTime objDate = Convert.ToDateTime(txtFromDateUpdate.Text, dtfi);
                        objevent.Date_From = objDate;
                    }

                    if (ToDateUpdate.Text.Length == 0)
                    {
                        objevent.Date_to = null;
                    }
                    else
                    {
                        DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
                        dtfi.ShortDatePattern = "MM/dd/yyyy";
                        dtfi.DateSeparator    = "/";
                        DateTime objDate = Convert.ToDateTime(ToDateUpdate.Text, dtfi);
                        objevent.Date_to = objDate;
                    }
                    objevent.Location_id = Convert.ToString(GetLocationIDbyName(drlLocationUpdate.Text));
                    objevent.Event_Type  = ddlEventTypeUpdate.Text;

                    string time = TimeSelector3.Date.TimeOfDay.ToString();
                    objevent.Start_time = time;

                    string time1 = TimeSelector4.Date.TimeOfDay.ToString();
                    objevent.End_time = time1;

                    objevent.Special_Requirment = txtspecialreqUpdate.Text;
                    objevent.Guard_Requirment   = txtgaurdreqUpdate.Text;
                    objevent.Special_Duty       = txtdutygaurdUpdate.Text;
                    objevent.Incharg_Name       = txtNameUpdate.Text;
                    objevent.Incharg_NricNo     = txtNricNoUpdate.Text;
                    objevent.Incharg_position   = txtPositionUpdate.Text;
                    objevent.Incharg_ContactNo  = txtContactUpdate.Text;
                    objevent.Superior_Name      = txtSupireorNameUpdate.Text;


                    ws.Updatevent(objevent);
                    // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "AlertMessage", " alert('Record Update SuccessFully');", true);
                    SpaMaster MyMasterPage = (SpaMaster)Page.Master;

                    MyMasterPage.ShowErrorMessage("Record Updated SuccessFully..!");

                    this.ModalPopupUpdate.Hide();
                    ClearUpdate();
                    BindGridWithFilter();
                    //dal.executesql("Update PreRegisteredVisits set FromDate='" + txtFromDate.Text.Trim() + "',ToDate='" + txtToDate.Text.Trim() + "',ExpectedTime='" + newtime + "',Name='" + txtName.Text.Trim() + "',Company='" + txtCompany.Text.Trim() + "',Position='" + txtPosition.Text.Trim() + "',Invited_By='" + txtInvitedBy.Text.Trim() + "',LocationID='" + Searchid.Text + "',VechicleNo='" + txtVechicle.Text + "',Purpose='" + txtpurpose.Text + "',Telephoe='"+txttelephone.Text+"' where PRVID ='" + hdnCSID.Value + "' ");

                    //  HttpContext.Current.Items.Add(ContextKeys.CTX_COMPLETE, "UPDATE");
                    // Server.Transfer("AlertUpdateComplete.aspx");
                }
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
示例#7
0
        protected void cmdbuttonadd_Click(object sender, EventArgs e)
        {
            SpaMaster MyMasterPage = (SpaMaster)Page.Master;

            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AddNewEventmanRequest objAddEventmanRequest = new AddNewEventmanRequest();
                eventAdmin            objeventman           = new eventAdmin();
                DateTime datetime;
                if (txtNricNo.Text.Trim() != "" && txtname.Text.Trim() != "")
                {
                    // objeventman.Date_From = DateTime.TryParse(txtFromDate.Text, out datetime) ? (DateTime?)datetime : null;
                    // objeventman.Date_to = DateTime.TryParse(txttoDate.Text, out datetime) ? (DateTime?)datetime : null;
                    if (txtFromDate.Text.Length == 0)
                    {
                        objeventman.Date_From = null;
                    }
                    else
                    {
                        DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
                        dtfi.ShortDatePattern = "MM/dd/yyyy";
                        dtfi.DateSeparator    = "/";
                        DateTime objDate = Convert.ToDateTime(txtFromDate.Text, dtfi);
                        objeventman.Date_From = objDate;
                    }

                    if (txttoDate.Text.Length == 0)
                    {
                        objeventman.Date_to = null;
                    }
                    else
                    {
                        DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
                        dtfi.ShortDatePattern = "MM/dd/yyyy";
                        dtfi.DateSeparator    = "/";
                        DateTime objDate = Convert.ToDateTime(txttoDate.Text, dtfi);
                        objeventman.Date_to = objDate;
                    }



                    objeventman.Event_Type = drlEventType.Text.Trim();

                    objeventman.Start_time = TimeSelector1.Date.TimeOfDay.ToString();
                    objeventman.End_time   = TimeSelector2.Date.TimeOfDay.ToString();


                    objeventman.Special_Requirment = txtspecialreq.Text;
                    objeventman.Guard_Requirment   = txtgaurdreq.Text;
                    objeventman.Special_Duty       = txtdutygaurd.Text;
                    objeventman.Incharg_Name       = txtname.Text.Trim();
                    objeventman.Incharg_NricNo     = txtNricNo.Text.Trim();
                    objeventman.Incharg_position   = txtPosition.Text;
                    objeventman.Incharg_ContactNo  = txtContact.Text;
                    objeventman.Superior_Name      = txtSupireorName.Text;
                    string location_id = getLocationIDByName1(drlLocationAdd.SelectedItem.Text.ToString());
                    objeventman.Location_id = location_id;

                    AdminBLL ws = new AdminBLL();
                    ws.AddEvent(objeventman);
                    BindGridWithFilter();
                    //    this.ModalPopupAdd.Hide();
                    ClearAdd();
                    //dal.executesql("Update PreRegisteredVisits set FromDate='" + txtFromDate.Text.Trim() + "',ToDate='" + txtToDate.Text.Trim() + "',ExpectedTime='" + newtime + "',Name='" + txtName.Text.Trim() + "',Company='" + txtCompany.Text.Trim() + "',Position='" + txtPosition.Text.Trim() + "',Invited_By='" + txtInvitedBy.Text.Trim() + "',LocationID='" + Searchid.Text + "',VechicleNo='" + txtVechicle.Text + "',Purpose='" + txtpurpose.Text + "',Telephoe='"+txttelephone.Text+"' where PRVID ='" + hdnCSID.Value + "' ");
                    // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "AlertMessage", " alert('Record Insert SuccessFully');", true);


                    MyMasterPage.ShowErrorMessage("Record Inserted SuccessFully..!");



                    // HttpContext.Current.Items.Add("COMPLETE", "INSERT");
                    //Server.Transfer("..//SMSADMIN//AlertUpdateComplete.aspx");
                }
                else
                {
                    SM.ShowErrorMessage("Please Fill NRICno. & Name.....!");
                    //  lblerror.Visible = true;
                    //  lblerror.Text = "Please Fill NRICno. & Name.....!";
                }
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }