示例#1
0
 public void UpdateAssetAuditLog(smART.ViewModel.DispatcherRequest businessEntity, smART.Model.DispatcherRequest modelEntity, smART.Model.smARTDBContext dbContext)
 {
     if (businessEntity.RequestCategory.ToLower().Equals("bin") && businessEntity.RequestStatus.ToLower() == "close")
     {
         smART.Model.AssetAudit modelAssetAudit = new Model.AssetAudit();
         modelAssetAudit.Dispatcher_Request         = dbContext.T_Dispatcher.First(o => o.ID == modelEntity.ID);
         modelAssetAudit.Asset_Current_Location_Flg = true;
         modelAssetAudit.Asset             = modelEntity.Asset;
         modelAssetAudit.Active_Ind        = true;
         modelAssetAudit.Created_By        = modelEntity.Updated_By;
         modelAssetAudit.Updated_By        = modelEntity.Updated_By;
         modelAssetAudit.Created_Date      = modelEntity.Last_Updated_Date;
         modelAssetAudit.Last_Updated_Date = modelEntity.Last_Updated_Date;
         modelAssetAudit.Date = modelEntity.Time;
         if (businessEntity.RequestType.ToLower() == "drop off only")
         {
             modelAssetAudit.Party    = dbContext.M_Party.FirstOrDefault(o => o.ID == modelEntity.Party.ID);
             modelAssetAudit.Location = dbContext.M_Address.FirstOrDefault(o => o.ID == modelEntity.Location.ID);
             new smART.Business.Rules.AssetAudit().AddNewLocation(modelAssetAudit, dbContext);
         }
         else if (businessEntity.RequestType.ToLower() == "pickup only")
         {
             Model.Party       modelParty   = dbContext.M_Party.Where(o => o.Party_Type.ToLower() == "organization").FirstOrDefault();
             Model.AddressBook modelAddress = dbContext.M_Address.Where(o => o.Party.ID == modelParty.ID && o.Primary_Flag == true).FirstOrDefault();
             modelAssetAudit.Party    = modelParty;
             modelAssetAudit.Location = modelAddress;
             new smART.Business.Rules.AssetAudit().AddNewLocation(modelAssetAudit, dbContext);
         }
     }
 }
示例#2
0
 public frmSearch()
 {
     InitializeComponent();
     oMStudent  = new Model.Student();
     oMParty    = new Model.Party();
     oMPosition = new Model.Position();
     eVariable.DisableTextPanelEnterKey(panel3);
     eVariable.DisableKeyPress(cboSearch);
 }
 public Task CreateAsync(Party party)
 {
     var newParty = new Model.Party
     {
         Id = party.Id,
         MatchmakeState = party.MatchmakeState,
         GameData = party.GameData
     };
     _context.Parties.Add(newParty);
     _context.SaveChanges();
     return Task.FromResult(0);
 }
示例#4
0
        public Task CreateAsync(Party party)
        {
            var newParty = new Model.Party
            {
                Id             = party.Id,
                MatchmakeState = party.MatchmakeState,
                GameData       = party.GameData
            };

            _context.Parties.Add(newParty);
            _context.SaveChanges();
            return(Task.FromResult(0));
        }
示例#5
0
 void DatagridSelect(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (dgParty.Rows.Count > 0 && e.RowIndex >= 0)
         {
             oMParty        = new Model.Party();
             oMParty.ID     = dgParty.Rows[e.RowIndex].Cells[0].Value.ToString().Trim();
             oMParty.PARTY  = dgParty.Rows[e.RowIndex].Cells[1].Value.ToString().Trim();
             oMParty.STATUS = dgParty.Rows[e.RowIndex].Cells[2].Value.ToString().Trim();
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#6
0
        public void InsertParty(Model.Party oData)
        {
            try
            {
                osb.ConnectionString = sConnectionString;
                ddq = new DatabaseQuery.DBQuery();
                ddq.ConnectionString = osb.ConnectionString;

                ddq.CommandText = "Insert Into tbl_Party (Party,Status) Values ('" + oData.PARTY + "','" + oData.STATUS + "')";
                ddq.ExecuteNonQuery(CommandType.Text);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#7
0
        public bool UpdateParty(Model.Party oData)
        {
            try
            {
                osb.ConnectionString = sConnectionString;
                ddq = new DatabaseQuery.DBQuery();
                ddq.ConnectionString = osb.ConnectionString;

                ddq.CommandText = "Update tbl_Party set Status = '" + oData.STATUS + "', Party = '" + oData.PARTY + "' Where ID  = '" + oData.ID + "'";
                ddq.ExecuteNonQuery(CommandType.Text);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
示例#8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            oParty = new DataAccess.Party();
            if (txtParty.Text.Trim() != String.Empty)
            {
                oMParty        = new Model.Party();
                oMParty.ID     = eVariable.sID;
                oMParty.PARTY  = txtParty.Text;
                oMParty.STATUS = chkStatus.Checked == true ? "ACTIVE" : "INACTIVE";

                if (TransactionType == eVariable.TransactionType.EDIT)
                {
                    if (!oParty.UpdateParty(oMParty))
                    {
                        oFrmMsgBox             = new frmMessageBox("THIS RECORD CANNOT BE UPDATED");
                        oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                        oFrmMsgBox.ShowDialog();
                        TransactionType = eVariable.TransactionType.ADD;
                        LoadParty();
                        eVariable.ClearText(panel3);
                        return;
                    }
                }
                else
                {
                    if (oParty.IsPartyExists(txtParty.Text))
                    {
                        oFrmMsgBox             = new frmMessageBox("RECORD ALREADY EXISTS");
                        oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                        oFrmMsgBox.ShowDialog();
                        return;
                    }

                    oParty = new DataAccess.Party();
                    oParty.InsertParty(oMParty);
                }
                oFrmMsgBox             = new frmMessageBox("RECORD SUCCESSFULLY SAVED");
                oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                oFrmMsgBox.ShowDialog();
                TransactionType = eVariable.TransactionType.ADD;
                LoadParty();
                eVariable.ClearText(panel3);
            }
        }
示例#9
0
        private void SelectRecord()
        {
            if (dgDetails.Rows.Count >= 0 && iRowIndex >= 0)
            {
                if (RecordType == RECORD_TYPE.STUDENT)
                {
                    oMStudent = new Model.Student();

                    oMStudent.UNIQUE_ID   = dgDetails.Rows[iRowIndex].Cells[0].Value.ToString();
                    oMStudent.FIRST_NAME  = dgDetails.Rows[iRowIndex].Cells[1].Value.ToString();
                    oMStudent.MIDDLE_NAME = dgDetails.Rows[iRowIndex].Cells[2].Value.ToString();
                    oMStudent.LAST_NAME   = dgDetails.Rows[iRowIndex].Cells[3].Value.ToString();
                    oMStudent.DOB         = dgDetails.Rows[iRowIndex].Cells[4].Value.ToString();
                    oMStudent.AGE         = dgDetails.Rows[iRowIndex].Cells[5].Value.ToString();
                    oMStudent.COURSE      = dgDetails.Rows[iRowIndex].Cells[6].Value.ToString();
                    oMStudent.SECTION     = dgDetails.Rows[iRowIndex].Cells[7].Value.ToString();
                    oMStudent.CONTACT_NO  = dgDetails.Rows[iRowIndex].Cells[8].Value.ToString();
                    oMStudent.ADDRESS     = dgDetails.Rows[iRowIndex].Cells[9].Value.ToString();
                }
                else if (RecordType == RECORD_TYPE.PARTY)
                {
                    oMParty = new Model.Party();

                    oMParty.ID    = dgDetails.Rows[iRowIndex].Cells[0].Value.ToString();
                    oMParty.PARTY = dgDetails.Rows[iRowIndex].Cells[1].Value.ToString();
                }
                else if (RecordType == RECORD_TYPE.POSITION)
                {
                    oMPosition = new Model.Position();

                    oMPosition.ID       = dgDetails.Rows[iRowIndex].Cells[0].Value.ToString();
                    oMPosition.POSITION = dgDetails.Rows[iRowIndex].Cells[1].Value.ToString();
                }
            }

            Close();
        }
示例#10
0
 public static Model.Party CreateParty(Model.Party party)
 {
     party.Id = nextId++;
     parties.Add(party);
     return(GetParty(party.Id));
 }