Beispiel #1
0
 private void LoadRecords()
 {
     dgDetails.Rows.Clear();
     eVariable.DisableGridColumnSort(dgDetails);
     if (oFindOption == FIND_OPTION.AUTHOR)
     {
         AuthorStructure();
         oAuthor = new DataAccess.Author();
         foreach (DataRow row in oAuthor.GetAuthor(cboSearch.Text, txtSearch.Text).Rows)
         {
             dgDetails.Rows.Add(row[0].ToString(), row[1].ToString(), row[2].ToString(), row[3].ToString(), row[4].ToString());
         }
     }
     else if (oFindOption == FIND_OPTION.CATEGORY)
     {
         CategoryStructure();
         oCategory = new DataAccess.Category();
         foreach (DataRow row in oCategory.GetCategory(cboSearch.Text, txtSearch.Text).Rows)
         {
             dgDetails.Rows.Add(row[0].ToString(), row[1].ToString(), row[2].ToString());
         }
     }
     else if (oFindOption == FIND_OPTION.LOCATION)
     {
         LocationStructure();
         oLocation = new DataAccess.Location();
         foreach (DataRow row in oLocation.GetLocationRecord(cboSearch.Text, txtSearch.Text).Rows)
         {
             dgDetails.Rows.Add(row[0].ToString(), row[1].ToString(), row[2].ToString());
         }
     }
 }
 public static Location Map(DataAccess.Location location) => new Location
 {
     LocId         = location.Id,
     StreetAddress = location.Street,
     City          = location.City,
     State         = location.State,
     Zip           = location.Zip
 };
Beispiel #3
0
 public DataAccess.Location ToDataAccessModel(DataAccess.Location daLoc = null)
 {
     if (daLoc == null)
     {
         daLoc = new DataAccess.Location();
     }
     daLoc.Id = this.Id;
     daLoc.Name = this.Name;
     daLoc.ImportanceCategory = this.ImportanceCategory;
     daLoc.Latitude = this.Latitude;
     daLoc.Longitude = this.Longitude;
     return daLoc;
 }
Beispiel #4
0
 public void LoadLocation()
 {
     try
     {
         oLocation = new DataAccess.Location();
         dgDetails.Rows.Clear();
         eVariable.DisableGridColumnSort(dgDetails);
         foreach (DataRow row in oLocation.GetLocationRecord("", "").Rows)
         {
             dgDetails.Rows.Add(row[0], row[1], row[2]);
         }
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            oMLocation = new Model.Location();
            oLocation  = new DataAccess.Location();

            if (eVariable.IsFieldEmpty(pnlBody))
            {
                oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.ALL_FIELDS_ARE_REQUIRED.ToString().Replace("_", " "));
                oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                oFrmMsgBox.ShowDialog();
                return;
            }

            if (eVariable.m_ActionType == eVariable.ACTION_TYPE.EDIT)
            {
                oMLocation.LOCATION_ID = eVariable.sUniqueID;
                oMLocation.LOCATION    = txtLocation.Text;
                oMLocation.STATUS      = chkActive.Checked == true ? "ACTIVE" : "INACTIVE";
                oLocation.UpdateCategory(oMLocation);
            }
            else
            {
                oMLocation.LOCATION = txtLocation.Text;
                oMLocation.STATUS   = chkActive.Checked == true ? "ACTIVE" : "INACTIVE";

                if (oLocation.isRecordExists(oMLocation))
                {
                    oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.RECORD_IS_ALREADY_EXISTS.ToString().Replace("_", " "));
                    oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                    oFrmMsgBox.ShowDialog();
                    return;
                }


                oLocation.InsertLocation(oMLocation);
            }

            oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.RECORD_HAS_BEEN_SUCESSFULLY_SAVED.ToString().Replace("_", " "));
            oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
            oFrmMsgBox.ShowDialog();
            eVariable.ClearText(pnlBody);
            LoadLocation();
        }
 // Location
 public static Library.Location Map(DataAccess.Location location) => new Library.Location
 {
     Id = location.LocationId
 };