Exemplo n.º 1
0
        /// <summary>
        /// Handles the OnClick event of the lbtnSaveNonGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void lbtnSaveNonGrid_OnClick(object sender, EventArgs e)
        {
            if (SaveClicked != null)
            {
                var taskDuration = new TaskDurationMap
                {
                    ID = Guid.NewGuid(),
                    SectionDateStart      = rdpStartDate.SelectedDate,
                    SectionDateEnd        = rdpEndDate.SelectedDate,
                    ActualDurationHours   = (int?)rntxtActualDurationHours.Value,
                    ActualDurationMinutes = (int?)rntxtActualDurationMinutes.Value,
                    ResponsibleID         = ucResponsible.SelectedValue
                };
                var eventArgs = new SaveClickEventArgs {
                    TaskDuration = taskDuration
                };
                SaveClicked(this, eventArgs);
            }

            BindData();

            if (!Page.ClientScript.IsStartupScriptRegistered("CloseRadWindow"))
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "CloseRadWindow", "CloseRadWindow();", true);
            }
        }
Exemplo n.º 2
0
        private void FileNamePanel1_SaveClick(SaveClickEventArgs e)
        {
            this.ShowArchive(e.FilePath, this.archiveBook.PageIndex);

            this.fileNamePanel1.Visible = false;
            this.FileListBox.Visible    = true;
        }
 private bool ServiceDepartment_atSaveClick(object source, SaveClickEventArgs e)
 {
     try
     {
         if (NewRecord)
         {
             GetSeqNo();
             s_Department = new ServiceDepartment();
         }
         s_Department.LocationID     = GlobalFunctions.LoginLocationID;
         s_Department.LoginUserID    = GlobalFunctions.LoginUserID;
         s_Department.DepartmentCode = txtCode.Text;
         s_Department.DepartmentName = txtName.Text;
         if (NewRecord)
         {
             db.ServiceDepartments.AddObject(s_Department);
         }
         if (!NewRecord)
         {
             db.ObjectStateManager.ChangeObjectState(s_Department, System.Data.EntityState.Modified);
         }
         db.SaveChanges();
         PopulateServiceDepartment();
         return(true);
     }
     catch (UpdateException updEx)
     {
         db.DetachAllEntities();
         if (updEx.InnerException.Message.Contains("UC_ServiceDepartmentCode"))
         {
             if (FirstSaveClick == true && atMessageBox.Show(MessageKeys.MsgCodeAlreadyExistsDoYouWantToFollowTheSeriesBasedOnPreviousSequence, MessageBoxButtons.YesNo) == DialogResult.No)
             {
                 txtCode.Focus();
                 return(false);
             }
             FirstSaveClick = false;
             return(ServiceDepartment_atSaveClick(source, e));
         }
         else if (updEx.InnerException != null)
         {
             if (updEx.InnerException.Message.Contains("UC_ServiceDepartmentName"))
             {
                 atMessageBox.Show(MessageKeys.MsgAnother + MessageKeys.MsgService + " (" + txtName.Text + ") "
                                   + MessageKeys.MsgWithSameNameAlreadyExistsPleaseEnterDifferentName);
                 txtName.Focus();
                 return(false);
             }
         }
         ExceptionManager.Publish(updEx);
         atMessageBox.Show(updEx, ENOperation.Save);
         return(false);
     }
     catch (Exception ex)
     {
         db.DetachAllEntities();
         ExceptionManager.Publish(ex);
         atMessageBox.Show(ex, ENOperation.Save);
         return(false);
     }
 }
Exemplo n.º 4
0
        private bool FrmServiceInsuranceView_atSaveClick(object source, SaveClickEventArgs e)
        {
            try
            {
                if (NewRecord)
                {
                    GetSeqNo();
                    m_ServiceInsurance = new ServiceInsurance();
                }

                m_ServiceInsurance.LocationID    = GlobalFunctions.LoginLocationID;
                m_ServiceInsurance.LoginUserID   = GlobalFunctions.LoginUserID;
                m_ServiceInsurance.InsuranceCode = txtInsuranceCode.Text.ToString();
                m_ServiceInsurance.InsuranceName = txtInsuranceName.Text.ToString();
                m_ServiceInsurance.Description   = txtDescription.Text.ToString();
                m_ServiceInsurance.CompanyName   = cmbCompany.Text.ToString();
                if (NewRecord)
                {
                    db.ServiceInsurances.AddObject(m_ServiceInsurance);
                }
                else
                {
                    db.ObjectStateManager.ChangeObjectState(m_ServiceInsurance, EntityState.Modified);
                }
                db.SaveChanges();
                return(true);
            }
            catch (UpdateException updEx)
            {
                db.DetachAllEntities();

                ExceptionManager.Publish(updEx);
                atMessageBox.Show(MessageKeys.MsgExceptionOccurredWhileSaving);

                return(false);
            }
            catch (Exception ex)
            {
                db.DetachAllEntities();
                ExceptionManager.Publish(ex);
                atMessageBox.Show(MessageKeys.MsgExceptionOccurredWhileSaving);
                return(false);
            }
        }
        public void SaveButtonClick(object sender, EventArgs e)
        {
            // validate the page
            if (!Page.IsValid)
            {
                return;
            }

            // pluck off the values we need from the form
            var args = new SaveClickEventArgs
            {
            };

            // send over to the presenter
            if (SaveClick != null)
            {
                SaveClick(this, args);
            }
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
        }
Exemplo n.º 6
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            this.model.Type        = this.NameTextBox1.Text;
            this.model.Junle       = this.NameTextBox2.Text;
            this.model.Writer      = this.NameTextBox3.Text;
            this.model.Title       = this.NameTextBox4.Text;
            this.model.No          = this.NameTextBox5.Text;
            this.model.ReleaseDate = this.NameTextBox6.Text;
            this.model.SubTitle    = this.NameTextBox7.Text;

            var value1 = this.CreateList(this.NameTextBox1.Items, this.model.Type);

            Settings.Default.NameText1 = value1;
            var value2 = this.CreateList(this.NameTextBox2.Items, this.model.Junle);

            Settings.Default.NameText2 = value2;
            var value3 = this.CreateList(this.NameTextBox3.Items, this.model.Writer);

            Settings.Default.NameText3 = value3;
            var value4 = this.CreateList(this.NameTextBox4.Items, this.model.Title);

            Settings.Default.NameText4 = value4;
            var value5 = this.CreateList(this.NameTextBox7.Items, this.model.SubTitle);

            Settings.Default.NameText7 = value5;
            Settings.Default.Save();

            var fileNameList = new FileNameList();

            fileNameList.Initialize();
            fileNameList.ChangeFileName(this.model);

            var args = new SaveClickEventArgs(this.model.FilePath);

            this.SaveClick(args);
        }
Exemplo n.º 7
0
        /// <summary>
        /// </summary>
        public void Save(object sender, SaveClickEventArgs args)
        {
            Item saveItem = new Item();

            try
            {
                //Update Model
                if (base.View.ItemId != 0)
                {
                    saveItem = (Item)_repository.GetItem(base.View.ItemId, base.ModuleId);
                }
                else
                {
                    saveItem.CreatedOnDate   = DateTime.Now;
                    saveItem.CreatedByUserId = base.UserId;
                }
                saveItem.ItemName             = base.View.ItemName;
                saveItem.ItemDescription      = base.View.ItemDescription;
                saveItem.AssignedUserId       = base.View.AssignedUserId;
                saveItem.LastModifiedOnDate   = DateTime.Now;
                saveItem.LastModifiedByUserId = base.UserId;
                saveItem.ModuleId             = base.ModuleId;
                if (base.View.ItemId == 0)
                {
                    _repository.CreateItem(saveItem);
                }
                else
                {
                    _repository.UpdateItem(saveItem);
                }
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
            }
        }
Exemplo n.º 8
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            var args = new SaveClickEventArgs(this.model.FilePath);

            this.SaveClick(args);
        }