Пример #1
0
        public short SaveClassFeeSetting(Class_Fee_Setting_Model classFeeSettingModels)
        {
            short result;

            try
            {
                using (SqlService sqlService = new SqlService(ConnectionString.ConnectionStrings))
                {
                    sqlService.AddParameter("@ClassFeeID", classFeeSettingModels.ClassFeeID);
                    sqlService.AddParameter("@ClassID", classFeeSettingModels.ClassID);
                    sqlService.AddParameter("@FeeTypeID", classFeeSettingModels.FeeTypeID);
                    sqlService.AddParameter("@FeeAmount", classFeeSettingModels.FeeAmount);
                    sqlService.AddParameter("@Active", classFeeSettingModels.Active);
                    sqlService.AddParameter("@IsApplicableOnStaffChild", classFeeSettingModels.IsApplicableOnStaffChild);
                    sqlService.AddParameter("@AmountForStaffChild", classFeeSettingModels.AmountForStaffChild);
                    sqlService.AddParameter("@Academic_Year", classFeeSettingModels.AcademicYear);
                    sqlService.AddOutputParameter("@Result", SqlDbType.SmallInt);
                    sqlService.ExecuteSPNonQuery("dbo.USP_SaveClassFeeSetting");
                    result = (short)sqlService.Parameters["@Result"].Value;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Пример #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (ValidateControls())
     {
         _classFeeSettingModel            = new Class_Fee_Setting_Model();
         _classFeeSettingModel.ClassFeeID = string.IsNullOrWhiteSpace(hdnClassFeeID.Text) ? null : (long?)Convert.ToInt64(hdnClassFeeID.Text);
         _classFeeSettingModel.ClassID    = Convert.ToInt16(ddlClass.SelectedValue) != 0 ? Convert.ToInt16(ddlClass.SelectedValue) : (Int16?)null;
         _classFeeSettingModel.FeeTypeID  = Convert.ToInt16(ddlFeeType.SelectedValue);
         _classFeeSettingModel.FeeAmount  = Convert.ToInt32(txtFeeAmount.Text);
         _classFeeSettingModel.Active     = chkApplicable.Checked == true ? true : false;
         _classFeeSettingModel.IsApplicableOnStaffChild = chkIsApplicapleOnStaffChild.Checked == true ? true : false;
         _classFeeSettingModel.AmountForStaffChild      = chkIsApplicapleOnStaffChild.Checked == true ? (short?)Convert.ToInt16(txtAmountForStaffChild.Text) : null;
         _classFeeSettingModel.AcademicYear             = Convert.ToInt32(ddlAcademicYear.SelectedValue);
         SaveDetails(_classFeeSettingModel);
     }
 }
Пример #3
0
        private void SaveDetails(Class_Fee_Setting_Model classFeeSettingModel)
        {
            try
            {
                _classFeeSetting = new ClassFeeSetting();
                short output = _classFeeSetting.SaveClassFeeSetting(classFeeSettingModel);
                switch (output)
                {
                case 1:
                    lblError.Visible = false;
                    MessageBox.Show("Record Successfully Saved.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    gridFeeSetting.Refresh();
                    //bind Grid on Insert And Update.
                    if (isSearchByFeeType == false)     //IF Search by Class Type DropDownList
                    {
                        ddlClass_SelectedIndexChanged(null, null);
                    }
                    if (isSearchByFeeType == true)    //IF Search by Fee Type DropDownList
                    {
                        linkSearchByFeeType_LinkClicked(null, null);
                    }
                    //ClearClontrol();
                    break;

                case -1:
                    // lblError.Visible = true;
                    //  lblError.Text = "Error! Please contact to admin.";
                    MessageBox.Show("Error! Please contact to support team.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;

                case 0:
                    // lblError.Visible = true;
                    // lblError.Text = "Record already Exit.";
                    MessageBox.Show("Record already Exit.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error! Please contact to support team.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }