コード例 #1
0
        public bool DeleteAllocation(RosterResourceAllocation models)
        {
            bool status = false;

            try
            {
                SqlParameter[] param =
                {
                    new SqlParameter("@SNo", models.MeetingID),
                };
                DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "DeleteResourceAllocation", param);
                status = Convert.ToBoolean(ds.Tables[0].Rows[0][0]);
            }
            catch (Exception ex)// (Exception ex)
            {
                status = false;
            }
            return(status);
        }
コード例 #2
0
        public List <SchedulerMessage> SaveAllocation(RosterResourceAllocation models)
        {
            bool   status = false;
            string error  = "";
            List <SchedulerMessage> SchedulerMessage = new List <SchedulerMessage>();

            try
            {
                SqlParameter[] param =
                {
                    new SqlParameter("@SNo",                models.MeetingID),
                    new SqlParameter("@EmpSNo",             models.Attendees[0]),
                    new SqlParameter("@DutyAreaSNo",        models.DutyAreaSNo),
                    new SqlParameter("@StartTime",          models.Start),
                    new SqlParameter("@EndTime",            models.End),
                    new SqlParameter("@AllocationType",     "1"),
                    new SqlParameter("@IsAllDay",           "0"),
                    new SqlParameter("@ReportingShiftTime", models.ReportingShiftTime),
                    new SqlParameter("@UpdatedBy",          "1"),
                    new SqlParameter("@EroorMsg",           SqlDbType.VarChar, 500)
                    {
                        Direction = ParameterDirection.Output
                    }
                };
                DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "CreateResourceAllocation", param);
                error  = Convert.ToString(param[param.Length - 1].Value);
                status = true;
            }
            catch (Exception ex)// (Exception ex)
            {
                status = false;
            }
            //return status;
            SchedulerMessage.Add(new SchedulerMessage()
            {
                Status = "Save", Result = "Success", Error = error
            });
            return(SchedulerMessage);
        }