예제 #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblError.Visible = false;
        int    iReturn    = 0;
        string sGroupType = tbGroupName.Text;
        //int iOrder = Convert.ToInt32(ntOrder.Text);
        int    GroupType;
        int    RowCount      = 0;
        string StatusVisible = "YES";
        string sPickType     = "GROUPTYPE";
        string GroupDesc     = ddlAffinity.SelectedText.ToString();

        if (sGroupType.Trim() != "")
        {
            if (GroupDesc != "")
            {
                GroupType = Convert.ToInt32(ddlAffinity.SelectedValue);
                //RowCount = Grid.Rows.Count;
                RowCount = GroupMaster.RowsCount(sPickType);

                RowCount++;
                try
                {
                    iReturn = GroupMaster.AddGroupType(sPickType, sGroupType, StatusVisible, RowCount);
                    if (iReturn == 1)
                    {
                        iReturn = GroupMaster.AddGroupTypeAffinity(GroupType, GroupDesc, RowCount);
                    }
                }
                catch (Exception ex)
                {
                    lblError.Visible = true;
                    lblError.Text    = ex.Message;
                }
            }
            else
            {
                lblError.Visible = true;
                lblError.Text    = "Please, select Imitation Type.";
            }
        }
        else
        {
            lblError.Visible = true;
            lblError.Text    = "Please, type Group Type.";
        }

        if (iReturn == 1) //Success
        {
            //ntOrder.Text = "";
            tbGroupName.Text   = "";
            pnlAddType.Visible = false;
            Grid.DataBind();
            Grid.Enabled     = true;
            btnSort.Enabled  = true;
            btnAdd.Enabled   = true;
            lblError.Visible = false;
            lblError.Text    = "";
        }
    }
예제 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblError.Visible = false;
        int    iReturn     = 0;
        string sReportName = tbReport.Text;

        //int iOrder = Convert.ToInt32(ntOrder.Text);
        try
        {
            iReturn = GroupMaster.AddReport(sReportName);
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text    = ex.Message;
        }

        if (iReturn == 1) //Success
        {
            //ntOrder.Text = "";
            tbReport.Text  = "";
            pnlAdd.Visible = false;
            Grid.DataBind();
        }
    }
예제 #3
0
        public async Task <IHttpActionResult> PutGroupMaster(int id, GroupMaster groupMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != groupMaster.GroupID)
            {
                return(BadRequest());
            }
            groupMaster.UpdateDate      = DateTime.Now;
            db.Entry(groupMaster).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GroupMasterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #4
0
        public object AddEbulletin(AddEbulletin addebulltn)
        {
            dynamic TBAddEbulletinResult;
            int     str = 0;

            try
            {
                string Result = Ebulletin.createEbulletin(addebulltn);

                if (!string.IsNullOrEmpty(Result))
                {
                    str = GlobalFuns.uploadDocs(addebulltn.grpID, Result, "ebulletin");
                }

                if (str == 0)
                {
                    TBAddEbulletinResult = new { status = "0", message = "success" };

                    if (addebulltn.ebulletinID != "0")
                    {
                        string url = ConfigurationManager.AppSettings["imgPath"] + "php/EditEbulletin.php?newsID=" + addebulltn.ebulletinID;
                        GroupMaster.Send(url);
                    }
                }
                else
                {
                    TBAddEbulletinResult = new { status = "1", message = "failed" }
                };
            }
            catch
            {
                TBAddEbulletinResult = new { status = "1", message = "failed" };
            }
            return(new { TBAddEbulletinResult });
        }
    protected void Grid_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        pnlAdd.Visible   = false;
        lblError.Visible = false;

        //Pre-update values
        int    TourID   = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["TourID"].ToString());
        string TourName = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["TourName"].ToString();

        //Post-update values
        GridEditableItem editItem  = e.Item as GridEditableItem;
        Hashtable        newValues = new Hashtable();

        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editItem);
        TourName = newValues["TourName"].ToString();

        try
        {
            GroupMaster.UpdateTheme(TourID, TourName);
            message.InnerHtml = "Theme was successfully updated.";
        }
        catch (Exception ex)
        {
            message.InnerText = ex.Message;
        }
    }
        public DataBaseResultSet SaveGroupMaster <T>(T objData) where T : class, IModel, new()
        {
            GroupMaster        obj    = objData as GroupMaster;
            string             sQuery = "sprocGroupMasterInsertUpdateSingleItem";
            List <DbParameter> list   = new List <DbParameter>();

            list.Add(SqlConnManager.GetConnParameters("GroupCode", "GroupCode", 8, GenericDataType.Long, ParameterDirection.Input, obj.GroupCode));
            list.Add(SqlConnManager.GetConnParameters("ICode", "ICode", 13, GenericDataType.String, ParameterDirection.Input, obj.ICode));
            list.Add(SqlConnManager.GetConnParameters("GroupName", "GroupName", 50, GenericDataType.String, ParameterDirection.Input, obj.GroupName));
            list.Add(SqlConnManager.GetConnParameters("CUser", "CUser", 8, GenericDataType.Long, ParameterDirection.Input, obj.CUser));
            list.Add(SqlConnManager.GetConnParameters("CDateTime", "CDateTime", 8, GenericDataType.DateTime, ParameterDirection.Input, obj.CDateTime));
            list.Add(SqlConnManager.GetConnParameters("EUser", "EUser", 8, GenericDataType.Long, ParameterDirection.Input, obj.EUser));
            list.Add(SqlConnManager.GetConnParameters("EDateTime", "EDateTime", 8, GenericDataType.DateTime, ParameterDirection.Input, obj.EDateTime));
            list.Add(SqlConnManager.GetConnParameters("LCode", "LCode", 8, GenericDataType.Long, ParameterDirection.Input, obj.LCode));
            list.Add(SqlConnManager.GetConnParameters("DLock", "DLock", 3, GenericDataType.String, ParameterDirection.Input, obj.DLock));
            list.Add(SqlConnManager.GetConnParameters("CreatedBy", "CreatedBy", 50, GenericDataType.String, ParameterDirection.Input, obj.CreatedBy));
            list.Add(SqlConnManager.GetConnParameters("CreatedDate", "CreatedDate", 8, GenericDataType.DateTime, ParameterDirection.Input, obj.CreatedDate));
            list.Add(SqlConnManager.GetConnParameters("UpdateddBy", "UpdateddBy", 50, GenericDataType.String, ParameterDirection.Input, obj.UpdateddBy));
            list.Add(SqlConnManager.GetConnParameters("UpdatedDate", "UpdatedDate", 8, GenericDataType.DateTime, ParameterDirection.Input, obj.UpdatedDate));
            list.Add(SqlConnManager.GetConnParameters("UpdatedCount", "UpdatedCount", 4, GenericDataType.Int, ParameterDirection.Input, obj.UpdatedCount));
            list.Add(SqlConnManager.GetConnParameters("LUT", "LUT", 8, GenericDataType.DateTime, ParameterDirection.Input, obj.LUT));
            list.Add(SqlConnManager.GetConnParameters("OperationFlag", "OperationFlag", 4, GenericDataType.Int, ParameterDirection.Input, (short)obj.OperationFlag));
            list.Add(SqlConnManager.GetConnParameters("Message", "Message", 300, GenericDataType.String, ParameterDirection.Output, null));
            list.Add(SqlConnManager.GetConnParameters("ErrorCode", "ErrorCode", 4, GenericDataType.Int, ParameterDirection.Output, null));
            return(SqlConnManager.Save(sQuery, CommandType.StoredProcedure, list.ToArray()));
        }
예제 #7
0
        public void Delete(object pp)
        {
            GroupMaster _DM = pp as GroupMaster;

            if (_DM != null)
            {
                if (_DM.GroupDetails.Where(w => w.IsDelete != true).Count() > 0)
                {
                    CustomDialogBox tempDB = new CustomDialogBox("Already used by Details.", DialogType.Information);
                    tempDB.ShowDialog();
                }
                else
                {
                    CustomDialogBox tempDB = new CustomDialogBox("Are you sure ?", DialogType.Question);
                    bool?           result = tempDB.ShowDialog();
                    if (result == true)
                    {
                        _DM.IsDelete               = true;
                        _DM.Deletedate             = DateTime.Now;
                        _Entities.Entry(_DM).State = EntityState.Modified;
                        _Entities.SaveChanges();
                        _CollectionOfGroupMaster.Remove(_DM);
                    }
                }
            }
        }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblError.Visible = false;
        int    iReturn = 0;
        string stbTask = tbTheme.Text;

        //int iOrder = Convert.ToInt32(ntOrder.Text);
        Grid.MasterTableView.ClearEditItems();
        Grid.Rebind();
        try
        {
            iReturn = GroupMaster.AddTheme(stbTask);
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text    = ex.Message;
        }

        if (iReturn == 1) //Success
        {
            tbTheme.Text   = "";
            pnlAdd.Visible = false;
            Grid.DataBind();
        }
    }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindToDataTableTypes(ddlTypes);
            BindToDataTableReports(ddlReports);

            int R = Convert.ToInt32(ddlReports.SelectedValue.ToString());
            int T = Convert.ToInt32(ddlTypes.SelectedValue.ToString());

            Grid1.DataSource = GroupMaster.GetReportTypesTasksList(R, T);
            Grid1.DataBind();

            if (Grid1.Rows.Count > 1)
            {
                btnSort.Visible = true;
            }
            else
            {
                btnSort.Visible = false;
            }


            Grid2.DataSource = GroupMaster.GetReportTypesTasksList2(R, T);
            Grid2.DataBind();

            pnlSort.Visible = false;
        }
    }
예제 #10
0
 public void save(object pp)
 {
     if (Cansave())
     {
         if (GroupMaster == null)
         {
             GroupMaster           = new GroupMaster();
             GroupMaster.GroupName = GroupName;
             GroupMaster.AddDate   = DateTime.Now;
             GroupMaster.IsDelete  = false;
             _Entities.GroupMasters.Add(GroupMaster);
             _Entities.SaveChanges();
             _CollectionOfGroupMaster.Insert(0, GroupMaster);
         }
         else
         {
             GroupMaster.GroupName = GroupName;
             GroupMaster.EditDate  = DateTime.Now;
             _Entities.Entry(GroupMaster).State = EntityState.Modified;
             _Entities.SaveChanges();
             CollectionViewSource.GetDefaultView(_CollectionOfGroupMaster).Refresh();
             FrmVis = "Hidden";
         }
         Clear(null);
     }
 }
예제 #11
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblError.Visible = false;
        int iReturn = 0;

        string InstructionType = ddlInstructionType.SelectedValue;
        string InstructionCode = tbGroupName.Text;

        try
        {
            iReturn = GroupMaster.AddInstruction(InstructionType, InstructionCode, 0);
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.Text    = ex.Message;
        }

        if (iReturn == 1) //Success
        {
            //ntOrder.Text = "";
            tbGroupName.Text           = "";
            pnlAddType.Visible         = false;
            Grid.Enabled               = true;
            btnSort.Enabled            = true;
            btnAdd.Enabled             = true;
            ddlInstructionType.Enabled = true;
            BindData();
        }
    }
예제 #12
0
        public async Task <GroupMasterViewModel> SaveGroupMasterViewModelDetails(GroupMasterViewModel grpMasterViewModel)
        {
            GroupMaster grpMaster = new GroupMaster()
            {
                Group_Code             = grpMasterViewModel.GroupCode,
                Group_Name             = grpMasterViewModel.GroupName,
                Sequence               = grpMasterViewModel.Sequence,
                Org_Id                 = grpMasterViewModel.OrgId,
                Status                 = grpMasterViewModel.Status,
                Is_Deleted             = grpMasterViewModel.IsDeleted,
                Created_By             = "aaaa",
                Modified_By            = "aaa",
                Created_Date           = DateTime.Today,
                Modified_Date          = DateTime.Today,
                GroupMasterDescription = grpMasterViewModel.GroupDescription
            };

            var grouppMaster = await _groupMasterDetailsHelper.CreateAsync(grpMaster);

            GroupMasterViewModel grpMsterViewModel = new GroupMasterViewModel()
            {
                GroupId = grouppMaster.Group_Id
            };

            return(grpMsterViewModel);
        }
        public ActionResult DeleteConfirmed(Guid id)
        {
            GroupMaster groupMaster = db.GroupMasters.Find(id);

            db.GroupMasters.Remove(groupMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #14
0
        /// <summary>
        /// Update Group Info
        /// </summary>
        /// <param name="groupInfo"></param>
        public void Update(GroupInfo groupInfo)
        {
            GroupMaster group = Dbs.Groups.Get(groupInfo.ID);

            group.Name        = groupInfo.Name;
            group.Description = groupInfo.Description;
            Dbs.Groups.Update(group);
        }
예제 #15
0
    protected void BindData()
    {
        DataTable dt           = new DataTable();
        string    sInstruction = ddlInstructionType.SelectedValue;

        dt = GroupMaster.GetInstructions(sInstruction);
        Grid.DataSource = dt;
        Grid.DataBind();
    }
예제 #16
0
        public async Task <ActionResult> DeleteConfirmed(Guid id)
        {
            GroupMaster groupMaster = await db.GroupMasters.FindAsync(id);

            db.GroupMasters.Remove(groupMaster);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public void GetListGroupMaster <T>(T objFilter, ref List <T> listData) where T : class, IModel, new()
        {
            string             sQuery  = "GetListGroupMaster";
            GroupMaster        objData = objFilter as GroupMaster;
            List <DbParameter> list    = new List <DbParameter>();

            list.Add(SqlConnManager.GetConnParameters("GroupCode", "GroupCode", 8, GenericDataType.Long, ParameterDirection.Input, objData.GroupCode));
            SqlConnManager.GetList <T>(sQuery, CommandType.StoredProcedure, list.ToArray(), FillGroupMasterDataFromReader, ref listData);
        }
 private void FillGroupMasterDataFromReader <T>(DbDataReader DbReader, ref List <T> listData) where T : class, IModel, new()
 {
     while (DbReader.Read())
     {
         T           obj     = new T();
         GroupMaster objData = obj as GroupMaster;
         obj.FillDataFromDB(DbReader);
         listData.Add(obj);
     }
 }
예제 #19
0
    private void BindToDataTableReports(Telerik.Web.UI.RadDropDownList dropdownlist)
    {
        DataTable links = new DataTable();

        links = GroupMaster.GetReportsList();

        dropdownlist.DataTextField  = "ReportName";
        dropdownlist.DataValueField = "ReportType";
        dropdownlist.DataSource     = links;
        dropdownlist.DataBind();
    }
예제 #20
0
        public void Edit(object pp)
        {
            GroupMaster _DM = pp as GroupMaster;

            if (_DM != null)
            {
                GroupMaster = _DM;
                GroupName   = _DM.GroupName;
                FrmVis      = "Visible";
            }
        }
예제 #21
0
        private static DateTime StartDate(string groupId)
        {
            GroupMaster g       = GroupMaster.GetGroupMaster(groupId);
            DateTime    startDt = DateTime.Today.AddYears(-6);

            if (Util.isValidDate(g.DepartDate))
            {
                startDt = Convert.ToDateTime(g.DepartDate).AddYears(-4);
            }
            return(startDt);
        }
예제 #22
0
        public async Task <IHttpActionResult> GetGroupMaster(int id)
        {
            GroupMaster groupMaster = await db.GroupMaster.FindAsync(id);

            if (groupMaster == null)
            {
                return(NotFound());
            }

            return(Ok(groupMaster));
        }
예제 #23
0
    // Start is called before the first frame update
    void Start()
    {
        groupMaster = master.groupMaster;
        colorChunks = new Dictionary <int, int>();
        int paletteLength = (256 * 6 / (int)hueChangeFactor);

        paletteArray = new Color[paletteLength];
        crateList    = new List <Crate>();

        BuildColorPalette();
    }
예제 #24
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Description,CreatedBy,CreatedDate,LastUpdatedDate,LastUpdatedBy,StatusCodeId")] GroupMaster groupMaster)
        {
            if (ModelState.IsValid)
            {
                db.Entry(groupMaster).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            // ViewBag.StatusCodeId = new SelectList(db.StatusCodeMasters, "Id", "StatusCodes", groupMaster.StatusCodeId);
            return(View(groupMaster));
        }
예제 #25
0
 public void InsertGroup(GroupMaster group)
 {
     try
     {
         context.GroupMasters.Add(group);
         //context.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #26
0
    protected void btnSort_Click(object sender, EventArgs e)
    {
        string InstructionType = ddlInstructionType.SelectedValue;

        RadListBox1.DataSource     = GroupMaster.GetInstructionSort(InstructionType);
        RadListBox1.DataTextField  = "InstructionCode";
        RadListBox1.DataValueField = "RID";
        RadListBox1.DataSortField  = "InstructionSort";
        RadListBox1.DataBind();
        pnlSort.Visible            = true;
        Grid.Enabled               = false;
        ddlInstructionType.Enabled = false;
    }
예제 #27
0
    protected void btnSort_Click(object sender, EventArgs e)
    {
        string PickType      = "GROUPTYPE";
        string StatusVisible = "YES";

        RadListBox1.DataSource     = GroupMaster.GetGroupTypeSort(PickType, StatusVisible);
        RadListBox1.DataTextField  = "PickDesc";
        RadListBox1.DataValueField = "PickCode";
        RadListBox1.DataSortField  = "Sort";
        RadListBox1.DataBind();
        pnlSort.Visible = true;
        Grid.Enabled    = false;
    }
예제 #28
0
        private void DoIndependentWork()
        {
            GroupMaster group = groupManager.FindGroup(Convert.ToInt32(txtGroupID.Text));

            txtName.Text = group?.GroupName;
            txtDesc.Text = group?.GroupDesc;
            string      name        = "sdfsd";
            Action      action      = () => { Thread.Sleep(50000); name = name + "99000090"; };
            ThreadStart threadStart = new ThreadStart(action);
            Thread      thread      = new Thread(threadStart);

            thread.Start();
        }
예제 #29
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Name,Description,CreatedBy,CreatedDate,LastUpdatedDate,LastUpdatedBy,StatusCodeId")] GroupMaster groupMaster)
        {
            if (ModelState.IsValid)
            {
                groupMaster.Id = Guid.NewGuid();
                db.GroupMasters.Add(groupMaster);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            // ViewBag.StatusCodeId = new SelectList(db.StatusCodeMasters, "Id", "StatusCodes", groupMaster.StatusCodeId);
            return(View(groupMaster));
        }
예제 #30
0
        // GET: GroupMasters/Details/5
        public async Task <ActionResult> Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GroupMaster groupMaster = await db.GroupMasters.FindAsync(id);

            if (groupMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(groupMaster));
        }