Esempio n. 1
0
        public static int ClaimDesignationConfig_Save(Entity.ClaimManagement.ClaimDesignationWiseConfiguration ClaimDesignationWiseConfiguration)
        {
            int retValue = 0;

            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = con;
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "usp_HR_ClaimDesignationConfig_Save";

                    cmd.Parameters.AddWithValue("@ClaimDesignationConfigId", ClaimDesignationWiseConfiguration.ClaimDesignationConfigId);
                    cmd.Parameters.AddWithValue("@ClaimCategoryId", ClaimDesignationWiseConfiguration.ClaimCategoryId);
                    cmd.Parameters.AddWithValue("@DesignationId", ClaimDesignationWiseConfiguration.DesignationId);
                    cmd.Parameters.AddWithValue("@Limit", ClaimDesignationWiseConfiguration.Limit);
                    cmd.Parameters.AddWithValue("@FollowupInterval", ClaimDesignationWiseConfiguration.FollowupInterval);

                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }
                    retValue = cmd.ExecuteNonQuery();
                    con.Close();
                }
            }
            return(retValue);
        }
Esempio n. 2
0
        private void ClaimDesignationWiseConfiguration_GetAll()
        {
            Business.ClaimManagement.ClaimDesignationWiseConfiguration objClaimDesignationWiseConfiguration = new Business.ClaimManagement.ClaimDesignationWiseConfiguration();
            Entity.ClaimManagement.ClaimDesignationWiseConfiguration   ClaimDesignationWiseConfiguration    = new Entity.ClaimManagement.ClaimDesignationWiseConfiguration();

            DataTable dt = objClaimDesignationWiseConfiguration.ClaimDesignationConfig_GetAll(ClaimDesignationWiseConfiguration);

            gvClaimDesignationConfiguration.DataSource = dt;
            gvClaimDesignationConfiguration.DataBind();
        }
Esempio n. 3
0
        private bool ClaimDesignationConfigValidate()
        {
            bool retValue = true;

            if (ddlClaimCategory.SelectedIndex == 0)
            {
                Message.IsSuccess = false;
                Message.Text      = "Please select Claim Type.";
                Message.Show      = true;
                return(false);
            }
            if (ddlDesignation.SelectedIndex == 0)
            {
                Message.IsSuccess = false;
                Message.Text      = "Please select Designation.";
                Message.Show      = true;
                return(false);
            }
            if (string.IsNullOrEmpty(txtClaimLimit.Text.Trim()))
            {
                Message.IsSuccess = false;
                Message.Text      = "Please enter Claim Limit.";
                Message.Show      = true;
                return(false);
            }

            Business.ClaimManagement.ClaimDesignationWiseConfiguration objClaimDesignationWiseConfiguration = new Business.ClaimManagement.ClaimDesignationWiseConfiguration();
            Entity.ClaimManagement.ClaimDesignationWiseConfiguration   ClaimDesignationWiseConfiguration    = new Entity.ClaimManagement.ClaimDesignationWiseConfiguration();
            ClaimDesignationWiseConfiguration.ClaimCategoryId = Convert.ToInt32(ddlClaimCategory.SelectedValue);
            ClaimDesignationWiseConfiguration.DesignationId   = Convert.ToInt32(ddlDesignation.SelectedValue);
            DataTable dt = objClaimDesignationWiseConfiguration.ClaimDesignationConfig_GetAll(ClaimDesignationWiseConfiguration);

            if (ClaimDesignationWiseConfigurationId == 0)
            {
                if (dt != null && dt.AsEnumerable().Any())
                {
                    Message.IsSuccess = false;
                    Message.Text      = "Designation configuration already exists.";
                    Message.Show      = true;
                    return(false);
                }
            }
            else
            {
                if (dt == null || !dt.AsEnumerable().Any())
                {
                    Message.IsSuccess = false;
                    Message.Text      = "Designation configuration does not exists.";
                    Message.Show      = true;
                    return(false);
                }
            }
            return(retValue);
        }
Esempio n. 4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ClaimDesignationConfigValidate())
                {
                    Business.ClaimManagement.ClaimDesignationWiseConfiguration objClaimDesignationWiseConfiguration = new Business.ClaimManagement.ClaimDesignationWiseConfiguration();
                    Entity.ClaimManagement.ClaimDesignationWiseConfiguration   ClaimDesignationWiseConfiguration    = new Entity.ClaimManagement.ClaimDesignationWiseConfiguration();

                    ClaimDesignationWiseConfiguration.ClaimDesignationConfigId = ClaimDesignationWiseConfigurationId;
                    ClaimDesignationWiseConfiguration.ClaimCategoryId          = Convert.ToInt32(ddlClaimCategory.SelectedValue);
                    ClaimDesignationWiseConfiguration.DesignationId            = Convert.ToInt32(ddlDesignation.SelectedValue);
                    ClaimDesignationWiseConfiguration.Limit            = Convert.ToDecimal(txtClaimLimit.Text.Trim());
                    ClaimDesignationWiseConfiguration.FollowupInterval = Convert.ToInt32(txtFollowupInterval.Text.Trim());
                    int response = objClaimDesignationWiseConfiguration.ClaimDesignationConfig_Save(ClaimDesignationWiseConfiguration);
                    if (response > 0)
                    {
                        Clear();
                        GlobalCache.RemoveAll();
                        ClaimDesignationWiseConfiguration_GetAll();
                        Message.IsSuccess = true;
                        Message.Text      = "Saved Successfully";
                    }
                    else
                    {
                        Message.IsSuccess = false;
                        Message.Text      = "Exists";
                    }
                }
                Message.Show = true;
            }
            catch (Exception ex)
            {
                ex.WriteException();
                Message.IsSuccess = false;
                Message.Text      = ex.Message;
                Message.Show      = true;
            }
        }
Esempio n. 5
0
 public static DataTable ClaimDesignationConfig_GetAll(Entity.ClaimManagement.ClaimDesignationWiseConfiguration ClaimDesignationWiseConfiguration)
 {
     using (DataTable dt = new DataTable())
     {
         using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
         {
             using (SqlCommand cmd = new SqlCommand())
             {
                 cmd.Connection  = con;
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.CommandText = "usp_HR_ClaimDesignationConfig_GetAll";
                 if (ClaimDesignationWiseConfiguration.ClaimCategoryId == 0)
                 {
                     cmd.Parameters.AddWithValue("@ClaimCategoryId", DBNull.Value);
                 }
                 else
                 {
                     cmd.Parameters.AddWithValue("@ClaimCategoryId", ClaimDesignationWiseConfiguration.ClaimCategoryId);
                 }
                 if (ClaimDesignationWiseConfiguration.DesignationId == 0)
                 {
                     cmd.Parameters.AddWithValue("@DesignationId", DBNull.Value);
                 }
                 else
                 {
                     cmd.Parameters.AddWithValue("@DesignationId", ClaimDesignationWiseConfiguration.DesignationId);
                 }
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(dt);
                 }
                 con.Close();
             }
         }
         return(dt);
     }
 }
Esempio n. 6
0
 public static DataTable ClaimDesignationConfig_GetAllCached(Entity.ClaimManagement.ClaimDesignationWiseConfiguration ClaimDesignationWiseConfiguration)
 {
     return(DataAccess.ClaimManagement.ClaimDesignationWiseConfiguration.ClaimDesignationConfig_GetAll(ClaimDesignationWiseConfiguration));
 }
Esempio n. 7
0
 public int ClaimDesignationConfig_Save(Entity.ClaimManagement.ClaimDesignationWiseConfiguration objClaimDesignation)
 {
     return(DataAccess.ClaimManagement.ClaimDesignationWiseConfiguration.ClaimDesignationConfig_Save(objClaimDesignation));
 }