예제 #1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                if (!ValidateInput())
                {
                    return;
                }

                if (CheckForUnclosedDays())
                {
                    MessageBox.Show("There is uncompleted day . Please Complete the day and retry again!.",
                                    Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                //DayMaster type = new DayMaster();
                //type.Id = int.Parse(lbl_id.Text.Trim());
                //type.CancelledUserId = commonFunctions.LoginuserID;
                //type.CancelReason = txt_cancelr.Text.Trim();
                //type.CencelledDate = DateTime.Now;
                //type.DateStamp = GetDateStamp();
                //type.Day = txt_day.Text.ToString();
                //type.Iscancel = chk_cancelday.Checked;
                //type.IsCompleted = false;
                //type.IsShiftCreated = false;

                if (MessageBox.Show("Do you want to insert this record?", Messaging.MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    CustomeRepository.InitializeDailyPumperAssign(GetDateStamp(), txt_day.Text.ToString());

                    GetData();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Has found when Saving data. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }