Example #1
0
File: Plan.cs Project: AjayHK1/LMS
        public int DeletePlanDetails()
        {
            int n = 0;

            try
            {
                PlanMaster p = new PlanMaster();
                p.PlanId = Convert.ToInt32(txtPlanID.Text);

                PlanMasterBL bl = new PlanMasterBL();
                n = bl.DeletePlanMasterdata(p);

                MessageBox.Show("Records are Deleted...");
            }

            catch (Exception ex)
            {
                MessageBox.Show("Records are not Deleted...Please Try Again");
            }

            finally
            {
            }

            return(n);
        }
Example #2
0
File: Plan.cs Project: AjayHK1/LMS
        public void SaveDetails()
        {
            PlanMaster objPlan = new PlanMaster();

            objPlan.PlanId         = Convert.ToInt32(txtPlanID.Text);
            objPlan.PlanName       = txtPlanName.Text;
            objPlan.DateOfCreation = dtpDateOfCreation.Value.Date.ToString("yyyy-MM-dd");
            objPlan.Limit          = Convert.ToInt32(txtLimit.Text);
            objPlan.BookOnHold     = Convert.ToInt32(txtBookOnHold.Text);
            objPlan.Validity       = dtpDateOfValidity.Value.Date.ToString("yyyy-MM-dd");
            objPlan.Amount         = Convert.ToDouble(txtAmount.Text);
            objPlan.Discount       = Convert.ToDouble(txtDiscount.Text);
            objPlan.Status         = cmbStatus.SelectedIndex;

            PlanMasterBL p = new PlanMasterBL();
            int          n = p.SavePlanMasterdata(objPlan);

            if (n > 0)
            {
                MessageBox.Show("Record is Saved", "Message", MessageBoxButtons.OK);
            }

            else
            {
                MessageBox.Show("Record is Not Saved", "Message", MessageBoxButtons.OK);
            }
        }
Example #3
0
File: Plan.cs Project: AjayHK1/LMS
        public void UpdatePlanDetails()
        {
            try
            {
                PlanMaster p = new PlanMaster();
                p.PlanId         = Convert.ToInt32(txtPlanID.Text);
                p.PlanName       = txtPlanName.Text;
                p.DateOfCreation = dtpDateOfCreation.Value.Date.ToString("yyyy-MM-dd");
                p.Limit          = Convert.ToInt32(txtLimit.Text);
                p.BookOnHold     = Convert.ToInt32(txtBookOnHold.Text);
                p.Validity       = dtpDateOfValidity.Value.Date.ToString("yyyy-MM-dd");
                p.Amount         = Convert.ToInt32(txtAmount.Text);
                p.Discount       = Convert.ToInt32(txtDiscount.Text);

                if (cmbStatus.SelectedItem == "Active")
                {
                    p.Status = 0;
                }

                else
                {
                    p.Status = 1;
                }

                PlanMasterBL bl = new PlanMasterBL();
                int          n  = bl.UpdatePlanMasterdata(p);
                MessageBox.Show("Record is Updated...");
            }

            catch (Exception ex)
            {
                MessageBox.Show("Records are not Saved...Please Try Again");
            }

            finally
            {
                //DisableControls(this);
            }
        }