Exemplo n.º 1
0
        public void PaymentInsert()
        {
            using (SqlConnection Connection = new SqlConnection(ConfigurationManager.AppSettings["WebApplication"]))
            {
                using (SqlCommand Command = new SqlCommand("BonusPlan.PaymentInsert", Connection))
                {
                    Command.CommandType    = CommandType.StoredProcedure;
                    Command.CommandTimeout = 600;

                    Command.Parameters.Add("@EmployeeID", SqlDbType.Int);
                    Command.Parameters["@EmployeeID"].Value = EmployeeID.NullIfEmpty();

                    Command.Parameters.Add("@CommunityNumber", SqlDbType.VarChar);
                    Command.Parameters["@CommunityNumber"].Value = CommunityNumber.NullIfEmpty();

                    Command.Parameters.Add("@Amount", SqlDbType.VarChar);
                    Command.Parameters["@Amount"].Value = Amount.NullIfEmpty();

                    Command.Parameters.Add("@BonusPlanID", SqlDbType.Int);
                    Command.Parameters["@BonusPlanID"].Value = BonusPlanID.NullIfEmpty();

                    Command.Parameters.Add("@Note", SqlDbType.VarChar);
                    Command.Parameters["@Note"].Value = Note.NullIfEmpty();

                    Command.Parameters.Add("@CreateBy", SqlDbType.VarChar);
                    Command.Parameters["@CreateBy"].Value = Audit.CreateBy.NullIfEmpty();

                    Connection.Open();
                    Command.ExecuteNonQuery();
                }
            }
        }
Exemplo n.º 2
0
        public void BonusPlanToUserCommunityInsert()
        {
            using (SqlConnection Connection = new SqlConnection(ConfigurationManager.AppSettings["WebApplication"]))
            {
                using (SqlCommand Command = new SqlCommand("BonusPlan.BonusPlanToUserCommunityInsert", Connection))
                {
                    Command.CommandType    = CommandType.StoredProcedure;
                    Command.CommandTimeout = 600;

                    Command.Parameters.Add("@BonusPlanID", SqlDbType.Int);
                    Command.Parameters["@BonusPlanID"].Value = BonusPlanID.NullIfEmpty();

                    Command.Parameters.Add("@EmployeeID", SqlDbType.Int);
                    Command.Parameters["@EmployeeID"].Value = EmployeeID.NullIfEmpty();

                    Command.Parameters.Add("@CommunityNumber", SqlDbType.VarChar);
                    Command.Parameters["@CommunityNumber"].Value = CommunityNumber.NullIfEmpty();

                    Command.Parameters.Add("@Percentage", SqlDbType.VarChar);
                    Command.Parameters["@Percentage"].Value = Percentage.NullIfEmpty();

                    Command.Parameters.Add("@FlatRate", SqlDbType.VarChar);
                    Command.Parameters["@FlatRate"].Value = FlatRate.NullIfEmpty();

                    Command.Parameters.Add("@BeginDt", SqlDbType.VarChar);
                    Command.Parameters["@BeginDt"].Value = BeginDt.NullIfEmpty();

                    Command.Parameters.Add("@EndDt", SqlDbType.VarChar);
                    Command.Parameters["@EndDt"].Value = EndDt.NullIfEmpty();

                    Command.Parameters.Add("@RollforwardFlg", SqlDbType.Int);
                    Command.Parameters["@RollforwardFlg"].Value = RollforwardFlg.NullIfEmpty("0");

                    Command.Parameters.Add("@CreateBy", SqlDbType.VarChar);
                    Command.Parameters["@CreateBy"].Value = Audit.CreateBy.NullIfEmpty();

                    Connection.Open();
                    Command.ExecuteNonQuery();
                }
            }
        }
Exemplo n.º 3
0
        public void FormInitialize()
        {
            if (Request.QueryString.HasValue("BonusPlanID", typeof(int)))
            {
                objBonusPlan.BonusPlanID = Request.QueryString["BonusPlanID"].ToString();
                BonusPlanHiddenID.Value  = objBonusPlan.BonusPlanID;
                objBonusPlan.BonusPlanDetailGet();

                DeleteFlg.Value = objSecurity.DeleteFlg.ToString();
                //Delete.Visible = objSecurity.DeleteFlg.ToString() == "1" ? true : false;
            }

            DropDownList dbOptions = new DropDownList();

            AtriaBase.UI.ListControl.ListPopulate(JobCodeID, "JobCode", "JobCodeID", objBonusPlan.JobCodeGet(), AtriaBase.UI.ListControl.NoItemSelectedBehavior.SelectOne);
            AtriaBase.UI.ListControl.ListPopulate(JobCodeCommunity, "Community", "CommunityNumber", objSecurity.CommunityUserAccessGet(), AtriaBase.UI.ListControl.NoItemSelectedBehavior.SelectAll);
            AtriaBase.UI.ListControl.ListPopulate(JobCategoryID, "JobCategory", "JobCategoryID", objBonusPlan.JobCategoryGet(), AtriaBase.UI.ListControl.NoItemSelectedBehavior.SelectOne);
            AtriaBase.UI.ListControl.ListPopulate(dbOptions, "Community", "CommunityNumber", objBonusPlan.BonusPlanToCommunityGet(), AtriaBase.UI.ListControl.NoItemSelectedBehavior.SelectOne);
            AtriaBase.UI.ListControl.ListPopulate(JobCodeEffectiveDt, "MonthName", "EffectiveDT", objBonusPlan.BonusPlanToJobCodeEffectiveDateGet(), AtriaBase.UI.ListControl.NoItemSelectedBehavior.SelectOne);
            JobCodeEffectiveDt.SelectedIndex = 2; // Default to current month
            var communities = dbOptions.Items.Cast <ListItem>()
                              .Where(i => !string.IsNullOrEmpty(i.Value))
                              .GroupBy(g => g.Value)
                              .Select(i => i.FirstOrDefault())
                              .OrderBy(i => i.Text).ToList();

            communities.Insert(0, new ListItem()
            {
                Text = "Select One...", Value = ""
            });

            ListItemCollection communitiesCollection = new ListItemCollection();

            communitiesCollection.AddRange(communities.ToArray());
            CommunityNumber.DataTextField  = "Text";
            CommunityNumber.DataValueField = "Value";
            CommunityNumber.DataSource     = communitiesCollection;
            CommunityNumber.DataBind();
        }